Windows: Fix memory leak SRXAFSCB_GetCellServ

In commit 19f1e0f7cf 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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 137ea396db)

Change-Id: Ia15bcbeec4ad3ff411fd599e2d57f1ead4c3be23
Reviewed-on: http://gerrit.openafs.org/8643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-09-25 13:01:53 -04:00
parent d9b7f61546
commit a30a4dc211

View File

@ -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;
}