diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index b6ac6d3173..68ba3cd0bd 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1907,7 +1907,12 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) pParentObj->res.code = pSql->res.code; } + assert(pParentObj->pSubs[pSupporter->index] == tres); + + pParentObj->pSubs[pSupporter->index] = 0; + taos_free_result(tres); taosTFree(pSupporter); + if (atomic_sub_fetch_32(&pState->numOfRemain, 1) > 0) { return; }