Merge pull request #1562 from taosdata/hotfix/rpcrealloc

return after free
This commit is contained in:
slguan 2020-04-08 22:21:59 +08:00 committed by GitHub
commit 99e0873a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -331,6 +331,7 @@ void *rpcReallocCont(void *ptr, int contLen) {
char *start = ((char *)ptr) - sizeof(SRpcReqContext) - sizeof(SRpcHead);
if (contLen == 0 ) {
free(start);
return NULL;
}
int size = contLen + RPC_MSG_OVERHEAD;