]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vos: free ubulkentries with xdr_free
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 24 Dec 2010 15:06:05 +0000 (10:06 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 10 Jan 2011 20:26:19 +0000 (12:26 -0800)
Instead of using free() to free the ubulkentries data structure
use xdr_free().

Reviewed-on: http://gerrit.openafs.org/3590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit a7836dda8c1aab18c937c7e8909d4d9a678a53fa)

Change-Id: I9af8aee92e0e187923ccd952a5487ea419446720
Reviewed-on: http://gerrit.openafs.org/3626
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/volser/vos.c

index ca1549bd0296e2fcd82cf067f05d8ec54c5d765a..2c55983c34c6b9001c750bdb23f5d40aa5d7cf07 100644 (file)
@@ -4425,8 +4425,8 @@ DeleteEntry(struct cmd_syndesc *as, void *arock)
     fprintf(STDOUT,
            "Total VLDB entries deleted: %lu; failed to delete: %lu\n",
            (unsigned long)totalBack, (unsigned long)totalFail);
-    if (arrayEntries.ubulkentries_val)
-       free(arrayEntries.ubulkentries_val);
+
+    xdr_free((xdrproc_t) xdr_ubulkentries, &arrayEntries);
     return 0;
 }
 
@@ -4621,10 +4621,7 @@ ListVLDB(struct cmd_syndesc *as, void *arock)
        }
 
        /* Free the bulk array */
-       if (arrayEntries.ubulkentries_val) {
-           free(arrayEntries.ubulkentries_val);
-           arrayEntries.ubulkentries_val = 0;
-       }
+        xdr_free((xdrproc_t) xdr_ubulkentries, &arrayEntries);
     }
 
     /* Here is where we now sort all the entries and print them */
@@ -4976,8 +4973,7 @@ BackSys(struct cmd_syndesc *as, void *arock)
     fprintf(STDOUT, "Total volumes backed up: %lu; failed to backup: %lu\n",
            (unsigned long)totalBack, (unsigned long)totalFail);
     fflush(STDOUT);
-    if (arrayEntries.ubulkentries_val)
-       free(arrayEntries.ubulkentries_val);
+    xdr_free((xdrproc_t) xdr_ubulkentries, &arrayEntries);
     return 0;
 }
 
@@ -5078,8 +5074,7 @@ UnlockVLDB(struct cmd_syndesc *as, void *arock)
        }
     }
 
-    if (arrayEntries.ubulkentries_val)
-       free(arrayEntries.ubulkentries_val);
+    xdr_free((xdrproc_t) xdr_ubulkentries, &arrayEntries);
     return 0;
 }