Catch memory allocate failure
This commit is contained in:
parent
65f9ab7650
commit
30853e5c25
@ -156,7 +156,12 @@ int server_GetDbTables(const wchar_t *db, int *pNum, PPRpcTables *tbls)
|
|||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (auto it = tables.begin(); it != tables.end(); it++) {
|
for (auto it = tables.begin(); it != tables.end(); it++) {
|
||||||
PRpcTables p = (PRpcTables)midl_user_allocate(sizeof(RpcTables_t));
|
PRpcTables p = (PRpcTables)midl_user_allocate(sizeof(RpcTables_t));
|
||||||
|
if (p == NULL) {
|
||||||
|
printf("server_GetDbTables midl_user_allocate Failed for p\n");
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
p->table = it->table;
|
p->table = it->table;
|
||||||
p->sql = it->sql;
|
p->sql = it->sql;
|
||||||
pp[index++] = p;
|
pp[index++] = p;
|
||||||
|
Loading…
Reference in New Issue
Block a user