fix state mem leak

This commit is contained in:
yihaoDeng 2023-08-02 03:21:39 +00:00
parent 83468a7710
commit d9fd95777a
1 changed files with 2 additions and 6 deletions

View File

@ -1617,12 +1617,6 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
if (len < 0) {
return -1;
}
if (pVal != NULL) {
*pVal = (char*)val;
} else {
taosMemoryFree(val);
}
if (pVLen != NULL) *pVLen = len;
if (pKTmp->opNum != pCur->number) {
taosMemoryFree(val);
@ -1638,6 +1632,8 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
} else {
taosMemoryFree(val);
}
if (pVLen != NULL) *pVLen = len;
*pKey = pKTmp->key;
return 0;
}