From 17154a3c0afa88f7bb25e2b642fc13ee69c2b7db Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 15 Feb 2013 22:34:36 +0000 Subject: [PATCH] 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 --- src/libadmin/bos/afs_bosAdmin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index 7057d2e..0d7cb38 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; /* -- 1.9.4