From ed605b6eb1081395d2e2a6d679ac539cda6df6de Mon Sep 17 00:00:00 2001 From: Changhua Date: Sat, 20 Aug 2022 22:15:58 +0800 Subject: [PATCH] Fix malloc size --- Spy/rpc_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Spy/rpc_server.cpp b/Spy/rpc_server.cpp index 1f70df7..ed552b5 100644 --- a/Spy/rpc_server.cpp +++ b/Spy/rpc_server.cpp @@ -125,7 +125,7 @@ int server_SendImageMsg(const wchar_t *wxid, const wchar_t *path) int server_GetMsgTypes(int *pNum, PPRpcIntBstrPair *msgTypes) { *pNum = g_WxMsgTypes.size(); - PPRpcIntBstrPair pp = (PPRpcIntBstrPair)midl_user_allocate(*pNum * sizeof(RpcIntBstrPair_t)); + PPRpcIntBstrPair pp = (PPRpcIntBstrPair)midl_user_allocate(*pNum * sizeof(PRpcIntBstrPair)); if (pp == NULL) { printf("server_GetMsgTypes midl_user_allocate Failed for pp\n"); return -2; @@ -153,7 +153,7 @@ int server_GetContacts(int *pNum, PPRpcContact *contacts) vector vContacts = GetContacts(); *pNum = vContacts.size(); - PPRpcContact pp = (PPRpcContact)midl_user_allocate(*pNum * sizeof(RpcContact_t)); + PPRpcContact pp = (PPRpcContact)midl_user_allocate(*pNum * sizeof(PRpcContact)); if (pp == NULL) { printf("server_GetMsgTypes midl_user_allocate Failed for pp\n"); return -2; @@ -207,7 +207,7 @@ int server_GetDbTables(const wchar_t *db, int *pNum, PPRpcTables *tbls) { vector tables = GetDbTables(db); *pNum = tables.size(); - PPRpcTables pp = (PPRpcTables)midl_user_allocate(*pNum * sizeof(RpcTables_t)); + PPRpcTables pp = (PPRpcTables)midl_user_allocate(*pNum * sizeof(PRpcTables)); if (pp == NULL) { printf("server_GetMsgTypes midl_user_allocate Failed for pp\n"); return -2;