提交 d9fd9577 编写于 作者: dengyihao's avatar dengyihao

fix state mem leak

上级 83468a77
...@@ -1617,12 +1617,6 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* ...@@ -1617,12 +1617,6 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
if (len < 0) { if (len < 0) {
return -1; return -1;
} }
if (pVal != NULL) {
*pVal = (char*)val;
} else {
taosMemoryFree(val);
}
if (pVLen != NULL) *pVLen = len;
if (pKTmp->opNum != pCur->number) { if (pKTmp->opNum != pCur->number) {
taosMemoryFree(val); taosMemoryFree(val);
...@@ -1638,6 +1632,8 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* ...@@ -1638,6 +1632,8 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
} else { } else {
taosMemoryFree(val); taosMemoryFree(val);
} }
if (pVLen != NULL) *pVLen = len;
*pKey = pKTmp->key; *pKey = pKTmp->key;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册