fix state mem leak

This commit is contained in:
yihaoDeng 2023-08-02 03:31:11 +00:00
parent 6cdf94fec0
commit 918eca4d22
1 changed files with 3 additions and 2 deletions

View File

@ -1610,6 +1610,9 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
const char* curKey = rocksdb_iter_key(pCur->iter, (size_t*)&kLen);
stateSessionKeyDecode((void*)&ktmp, (char*)curKey);
if (pVal != NULL) *pVal = NULL;
if (pVLen != NULL) *pVLen = 0;
SStateSessionKey* pKTmp = &ktmp;
const char* vval = rocksdb_iter_value(pCur->iter, (size_t*)&vLen);
char* val = NULL;
@ -1617,8 +1620,6 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
if (len < 0) {
return -1;
}
if (pVal != NULL) *pVal = NULL;
if (pVLen != NULL) *pVLen = 0;
if (pKTmp->opNum != pCur->number) {
taosMemoryFree(val);