]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 22 Mar 2013 14:46:12 +0000 (07:46 -0700)
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.

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>
(cherry picked from commit 17154a3c0afa88f7bb25e2b642fc13ee69c2b7db)

Change-Id: Iaa6e5166cb29799feb82ca29ef3e78ceea82d6e2
Reviewed-on: http://gerrit.openafs.org/9524
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libadmin/bos/afs_bosAdmin.c

index 016145a2d1108dc23c3c79e10f528afe6b30711a..22ed13e06384c48477ce30ee9f5bc76ab82f0c54 100644 (file)
@@ -170,7 +170,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 = (bos_server_p) malloc(sizeof(bos_server_t));
+    bos_server_p bos_server = (bos_server_p) calloc(1, sizeof(bos_server_t));
     int serverAddress;
 
     /*