diff --git a/src/WINNT/afsd/cm_rpc.c b/src/WINNT/afsd/cm_rpc.c index 683aa93eb0..76d857b3f6 100644 --- a/src/WINNT/afsd/cm_rpc.c +++ b/src/WINNT/afsd/cm_rpc.c @@ -165,7 +165,7 @@ long AFSRPC_GetToken( void __RPC_FAR * __RPC_USER midl_user_allocate (size_t cBytes) { - return ((void __RPC_FAR *) malloc(cBytes)); + return ((void __RPC_FAR *) calloc(cBytes, 1)); } void __RPC_USER midl_user_free(void __RPC_FAR * p) diff --git a/src/WINNT/afsd/rpc_srvsvc.c b/src/WINNT/afsd/rpc_srvsvc.c index 33f8210c71..6ad1646cdd 100644 --- a/src/WINNT/afsd/rpc_srvsvc.c +++ b/src/WINNT/afsd/rpc_srvsvc.c @@ -588,17 +588,17 @@ NET_API_STATUS NetrShareEnum( case 2: if (space_limited) space_available -= sizeof(InfoStruct->ShareInfo.Level2); - InfoStruct->ShareInfo.Level2->Buffer = calloc((enump->count - enump->next), sizeof(SHARE_INFO_2)); + InfoStruct->ShareInfo.Level2->Buffer = MIDL_user_allocate((enump->count - enump->next) * sizeof(SHARE_INFO_2)); break; case 1: if (space_limited) space_available -= sizeof(InfoStruct->ShareInfo.Level1); - InfoStruct->ShareInfo.Level1->Buffer = calloc((enump->count - enump->next), sizeof(SHARE_INFO_1)); + InfoStruct->ShareInfo.Level1->Buffer = MIDL_user_allocate((enump->count - enump->next) * sizeof(SHARE_INFO_1)); break; case 0: if (space_limited) space_available -= sizeof(InfoStruct->ShareInfo.Level0); - InfoStruct->ShareInfo.Level0->Buffer = calloc((enump->count - enump->next), sizeof(SHARE_INFO_0)); + InfoStruct->ShareInfo.Level0->Buffer = MIDL_user_allocate((enump->count - enump->next) * sizeof(SHARE_INFO_0)); break; } @@ -738,13 +738,13 @@ NET_API_STATUS NetrShareGetInfo( /* Allocate the memory for the response */ switch (Level) { case 2: - InfoStruct->ShareInfo2 = calloc(1, sizeof(SHARE_INFO_2)); + InfoStruct->ShareInfo2 = MIDL_user_allocate(sizeof(SHARE_INFO_2)); break; case 1: - InfoStruct->ShareInfo1 = calloc(1, sizeof(SHARE_INFO_1)); + InfoStruct->ShareInfo1 = MIDL_user_allocate(sizeof(SHARE_INFO_1)); break; case 0: - InfoStruct->ShareInfo0 = calloc(1, sizeof(SHARE_INFO_0)); + InfoStruct->ShareInfo0 = MIDL_user_allocate(sizeof(SHARE_INFO_0)); break; } @@ -952,16 +952,16 @@ NET_API_STATUS NetrServerGetInfo( */ switch (Level) { case 103: - InfoStruct->ServerInfo103 = calloc(1, sizeof(SERVER_INFO_103)); + InfoStruct->ServerInfo103 = MIDL_user_allocate(sizeof(SERVER_INFO_103)); break; case 102: - InfoStruct->ServerInfo102 = calloc(1, sizeof(SERVER_INFO_102)); + InfoStruct->ServerInfo102 = MIDL_user_allocate(sizeof(SERVER_INFO_102)); break; case 101: - InfoStruct->ServerInfo101 = calloc(1, sizeof(SERVER_INFO_101)); + InfoStruct->ServerInfo101 = MIDL_user_allocate(sizeof(SERVER_INFO_101)); break; case 100: - InfoStruct->ServerInfo100 = calloc(1, sizeof(SERVER_INFO_100)); + InfoStruct->ServerInfo100 = MIDL_user_allocate(sizeof(SERVER_INFO_100)); break; } diff --git a/src/WINNT/afsd/rpc_wkssvc.c b/src/WINNT/afsd/rpc_wkssvc.c index 805853e534..b97af5bf68 100644 --- a/src/WINNT/afsd/rpc_wkssvc.c +++ b/src/WINNT/afsd/rpc_wkssvc.c @@ -55,13 +55,13 @@ unsigned long NetrWkstaGetInfo( */ switch (Level) { case 102: - WkstaInfo->WkstaInfo102 = calloc(1, sizeof(WKSTA_INFO_102)); + WkstaInfo->WkstaInfo102 = MIDL_user_allocate(sizeof(WKSTA_INFO_102)); break; case 101: - WkstaInfo->WkstaInfo101 = calloc(1, sizeof(WKSTA_INFO_101)); + WkstaInfo->WkstaInfo101 = MIDL_user_allocate(sizeof(WKSTA_INFO_101)); break; case 100: - WkstaInfo->WkstaInfo100 = calloc(1, sizeof(WKSTA_INFO_100)); + WkstaInfo->WkstaInfo100 = MIDL_user_allocate(sizeof(WKSTA_INFO_100)); break; }