fix(query): fix memory leak in last_row query

This commit is contained in:
Haojun Liao 2022-09-30 17:10:55 +08:00
parent 4b1e8e0cec
commit 877c707ce6
1 changed files with 8 additions and 1 deletions

View File

@ -590,7 +590,10 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) {
goto _next_fileset;
}
tMapDataReset(&state->blockMap);
if (state->blockMap.pData != NULL) {
tMapDataClear(&state->blockMap);
}
code = tsdbReadDataBlk(state->pDataFReader, state->pBlockIdx, &state->blockMap);
if (code) goto _err;
@ -695,6 +698,10 @@ int32_t clearNextRowFromFS(void *iter) {
state->pBlockData = NULL;
}
if (state->blockMap.pData != NULL) {
tMapDataClear(&state->blockMap);
}
return code;
}