diff --git a/source/libs/executor/src/tsimplehash.c b/source/libs/executor/src/tsimplehash.c index ee60f09afd..8cd376e092 100644 --- a/source/libs/executor/src/tsimplehash.c +++ b/source/libs/executor/src/tsimplehash.c @@ -295,7 +295,11 @@ int32_t tSimpleHashIterateRemove(SSHashObj *pHashObj, const void *key, size_t ke } if (*pIter == (void *)GET_SHASH_NODE_DATA(pNode)) { - *pIter = pPrev; + if (!pPrev) { + *pIter = NULL; + } else { + *pIter = GET_SHASH_NODE_DATA(pPrev); + } } FREE_HASH_NODE(pNode);