From: Simon Wilkinson Date: Fri, 15 Feb 2013 22:34:36 +0000 (+0000) Subject: libadmin: Don't try to release garbage connection X-Git-Tag: upstream/1.8.0_pre1^2~1521 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=17154a3c0afa88f7bb25e2b642fc13ee69c2b7db;p=packages%2Fo%2Fopenafs.git libadmin: Don't try to release garbage connection 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 Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Derrick Brashear --- diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index 7057d2e9c..0d7cb388e 100644 --- a/src/libadmin/bos/afs_bosAdmin.c +++ b/src/libadmin/bos/afs_bosAdmin.c @@ -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; /*