From f33bf898b40d506948f6258b00c19de11ef03a64 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Wed, 15 May 2024 16:56:02 +0800 Subject: [PATCH] fix invalid free --- source/libs/stream/src/streamBackendRocksdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index 843b681efb..db13da5f3b 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -2740,8 +2740,10 @@ int32_t streamStateGetGroupKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, if (pKey->groupId == groupId) { return 0; } - if (pVal != NULL) taosMemoryFree((void*)*pVal); - *pVal = NULL; + if (pVal != NULL) { + taosMemoryFree((void*)*pVal); + *pVal = NULL; + } } return -1; }