fix: memleak
This commit is contained in:
parent
8d32fb4b89
commit
5a0a03e46d
|
@ -120,6 +120,8 @@ static int32_t monitorReportAsyncCB(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
.data = NULL};
|
.data = NULL};
|
||||||
if (monitorPutData2MonitorQueue(tmp) == 0) {
|
if (monitorPutData2MonitorQueue(tmp) == 0) {
|
||||||
p->fileName = NULL;
|
p->fileName = NULL;
|
||||||
|
} else {
|
||||||
|
taosCloseFile(&(p->pFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -714,7 +716,7 @@ static void* monitorThreadFunc(void* param) {
|
||||||
MonitorSlowLogData* slowLogData = NULL;
|
MonitorSlowLogData* slowLogData = NULL;
|
||||||
(void)taosReadQitem(monitorQueue, (void**)&slowLogData);
|
(void)taosReadQitem(monitorQueue, (void**)&slowLogData);
|
||||||
if (slowLogData != NULL) {
|
if (slowLogData != NULL) {
|
||||||
if (slowLogData->type == SLOW_LOG_READ_BEGINNIG) {
|
if (slowLogData->type == SLOW_LOG_READ_BEGINNIG && quitCnt == 0) {
|
||||||
if (slowLogData->pFile != NULL) {
|
if (slowLogData->pFile != NULL) {
|
||||||
monitorSendSlowLogAtBeginning(slowLogData->clusterId, &(slowLogData->fileName), slowLogData->pFile,
|
monitorSendSlowLogAtBeginning(slowLogData->clusterId, &(slowLogData->fileName), slowLogData->pFile,
|
||||||
slowLogData->offset);
|
slowLogData->offset);
|
||||||
|
@ -857,6 +859,7 @@ int32_t monitorPutData2MonitorQueue(MonitorSlowLogData data) {
|
||||||
if (taosWriteQitem(monitorQueue, slowLogData) == 0) {
|
if (taosWriteQitem(monitorQueue, slowLogData) == 0) {
|
||||||
(void)tsem2_post(&monitorSem);
|
(void)tsem2_post(&monitorSem);
|
||||||
} else {
|
} else {
|
||||||
|
taosCloseFile(&(slowLogData->pFile));
|
||||||
monitorFreeSlowLogData(slowLogData);
|
monitorFreeSlowLogData(slowLogData);
|
||||||
taosFreeQitem(slowLogData);
|
taosFreeQitem(slowLogData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue