libadmin: Don't free garbage
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 28 Feb 2013 22:07:12 +0000 (22:07 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 1 Mar 2013 00:25:16 +0000 (16:25 -0800)
Make sure that we initialise the nbulkentries structure to 0 before
we start work, so that if the failure handler is called, it doesn't
try to free garbage.

Caught by coverity (#985980)

Change-Id: If55faadd44f7bbc80abbdcd7842603d586db7581
Reviewed-on: http://gerrit.openafs.org/9317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/libadmin/vos/afs_vosAdmin.c

index 1fb8c00..12b1164 100644 (file)
@@ -325,7 +325,8 @@ vos_BackupVolumeCreateMultiple(const void *cellHandle,
     int equal = 0;
     char backbuf[1024];
 
-    memset((void *)&attr, 0, sizeof(attr));
+    memset(&attr, 0, sizeof(attr));
+    memset(&arrayEntries, 0, sizeof(arrayEntries));
 
     /*
      * Validate arguments