From: Jeffrey Altman Date: Thu, 8 Oct 2009 12:35:09 +0000 (-0400) Subject: Windows: use xdr_alloc to allocate memory for Callback data structs X-Git-Tag: openafs-devel-1_5_66~99 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=7197d35ef181bdbbe813ec7fd9c7e5173b801bdb Windows: use xdr_alloc to allocate memory for Callback data structs 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 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index d5e36da..81698ab 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -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);