fix(query): fix memory leak.

This commit is contained in:
Haojun Liao 2023-01-11 18:00:36 +08:00
parent 67a291955e
commit 7efdc9e27a
2 changed files with 21 additions and 2 deletions

View File

@ -157,6 +157,20 @@ void destroyEWindowOperatorInfo(void* param) {
return; return;
} }
if (pInfo->pRow != NULL) {
taosMemoryFree(pInfo->pRow);
}
if (pInfo->pStartCondInfo != NULL) {
filterFreeInfo(pInfo->pStartCondInfo);
pInfo->pStartCondInfo = NULL;
}
if (pInfo->pEndCondInfo != NULL) {
filterFreeInfo(pInfo->pEndCondInfo);
pInfo->pEndCondInfo = NULL;
}
cleanupBasicInfo(&pInfo->binfo); cleanupBasicInfo(&pInfo->binfo);
colDataDestroy(&pInfo->twAggSup.timeWindowData); colDataDestroy(&pInfo->twAggSup.timeWindowData);
@ -315,4 +329,9 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf
} }
} }
} }
colDataDestroy(ps);
taosMemoryFree(ps);
colDataDestroy(pe);
taosMemoryFree(pe);
} }

View File

@ -36,7 +36,7 @@ endi
# child table: single row window # child table: single row window
print ====> select count(*) from tba1 event_window start with f1 = 0 end with f3 = false; print ====> select count(*) from tba1 event_window start with f1 = 0 end with f3 = false;
sql select count(*) from tba1 event_window start with f1 = 0 end with f3 = false sql select count(*) from tba1 event_window start with f1 = 0 end with f3 = false
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
if $data00 != 1 then if $data00 != 1 then
@ -62,7 +62,7 @@ endi
if $data00 != 2 then if $data00 != 2 then
return -1 return -1
endi endi
if $data00 != 4 then if $data10 != 4 then
return -1 return -1
endi endi