Windows: Fix memory leak SRXAFSCB_GetCellServ
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 25 Sep 2012 17:01:53 +0000 (13:01 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 1 Oct 2012 23:21:32 +0000 (16:21 -0700)
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.

Change-Id: I0a9e6c03d67e2a1c811e84808fbbdd39f782ba87
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>

src/WINNT/afsd/cm_callback.c

index e245d3e..5e27a84 100644 (file)
@@ -1163,7 +1163,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;
     }