From a30a4dc2114aa2f7c319ecb7d213d658bd371af8 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 25 Sep 2012 13:01:53 -0400 Subject: [PATCH] Windows: Fix memory leak SRXAFSCB_GetCellServ In commit 19f1e0f7cf40c3da1d49c789358bd814f7e3b3eb strdup() was replaced by xdr_alloc() and memcpy(). Unfortunately, the patch was wrong and the pointer to which the result of xdr_alloc() was assigned was overwritten with zero. Reviewed-on: http://gerrit.openafs.org/8162 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman (cherry picked from commit 137ea396dbbcf302bce8200e3da7d4693b464ca7) Change-Id: Ia15bcbeec4ad3ff411fd599e2d57f1ead4c3be23 Reviewed-on: http://gerrit.openafs.org/8643 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 38dbab2632..3ef9f258b4 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -1142,7 +1142,7 @@ GetCellCommon(afs_int32 a_cellnum, char **a_name, serverList *a_hosts) if (!cellp) { *a_name = (char *)xdr_alloc(sizeof(char)); if (*a_name) - *a_name = '\0'; + *a_name[0] = '\0'; return 0; }