From: Jeffrey Altman Date: Tue, 25 Sep 2012 17:01:53 +0000 (-0400) Subject: Windows: Fix memory leak SRXAFSCB_GetCellServ X-Git-Tag: upstream/1.6.2_pre2^2~33 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a30a4dc2114aa2f7c319ecb7d213d658bd371af8;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 38dbab263..3ef9f258b 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; }