Merge pull request #17184 from taosdata/feature/3_liaohj

fix(query): fix memory leak in last_row query
This commit is contained in:
Haojun Liao 2022-09-30 17:51:45 +08:00 committed by GitHub
commit 7674fa972c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}