Windows: use xdr_alloc to allocate memory for Callback data structs
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 8 Oct 2009 12:35:09 +0000 (08:35 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 8 Oct 2009 13:13:54 +0000 (06:13 -0700)
xdr_alloc must be used instead of malloc in SRXAFSCB_GetLocalCell
and SRXAFSCB_GetCacheConfig

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/606
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/WINNT/afsd/cm_callback.c

index d5e36da..81698ab 100644 (file)
@@ -1401,7 +1401,7 @@ int SRXAFSCB_GetLocalCell(struct rx_call *callp, char **a_name)
     if (cm_data.rootCellp) {
         t_name = strdup(cm_data.rootCellp->name);
     } else {
-       t_name = (char *)malloc(1);
+       t_name = (char *)xdr_alloc(1);
        t_name[0] = '\0';
     }
     *a_name = t_name;
@@ -1500,7 +1500,7 @@ int SRXAFSCB_GetCacheConfig(struct rx_call *callp,
      * Currently only support version 1
      */
     allocsize = sizeof(cm_initparams_v1);
-    t_config = (afs_uint32 *)malloc(allocsize);
+    t_config = (afs_uint32 *)xdr_alloc(allocsize);
 
     afs_MarshallCacheConfig(callerVersion, &cm_initParams, t_config);