fix mem leak
This commit is contained in:
parent
54cf5c89e3
commit
d403a6129a
|
@ -155,10 +155,13 @@ void* rpcReallocCont(void* ptr, int64_t contLen) {
|
|||
|
||||
char* st = (char*)ptr - TRANS_MSG_OVERHEAD;
|
||||
int64_t sz = contLen + TRANS_MSG_OVERHEAD;
|
||||
st = taosMemoryRealloc(st, sz);
|
||||
if (st == NULL) {
|
||||
char* nst = taosMemoryRealloc(st, sz);
|
||||
if (nst == NULL) {
|
||||
taosMemoryFree(st);
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return NULL;
|
||||
} else {
|
||||
st = nst;
|
||||
}
|
||||
|
||||
return st + TRANS_MSG_OVERHEAD;
|
||||
|
|
Loading…
Reference in New Issue