libadmin: Don't try to release garbage connection
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 15 Feb 2013 22:34:36 +0000 (22:34 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 21 Feb 2013 12:52:08 +0000 (04:52 -0800)
In bos_ServerOpen, initalise the contents of bos_server structure
to 0 using calloc, so that if we jump to the error handling stuff
before they are assigned real values we don't end up trying to
release garbage.

Change-Id: I687d0b637833a08425e75391eb92a2dd4a150301
Reviewed-on: http://gerrit.openafs.org/9163
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/libadmin/bos/afs_bosAdmin.c

index 7057d2e..0d7cb38 100644 (file)
@@ -161,7 +161,7 @@ bos_ServerOpen(const void *cellHandle, const char *serverName,
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
-    bos_server_p bos_server = malloc(sizeof(bos_server_t));
+    bos_server_p bos_server = calloc(1, sizeof(bos_server_t));
     int serverAddress;
 
     /*