Merge pull request #24080 from taosdata/fix/TD-27891-3.0

fix/TD-27891
This commit is contained in:
Hongze Cheng 2023-12-15 17:56:00 +08:00 committed by GitHub
commit 94811d6cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "mnode.h" #include "mnode.h"
#include "audit.h" #include "audit.h"
#include "osMemory.h"
SAudit tsAudit = {0}; SAudit tsAudit = {0};
char* tsAuditUri = "/audit"; char* tsAuditUri = "/audit";
@ -36,9 +37,18 @@ int32_t auditInit(const SAuditCfg *pCfg) {
return 0; return 0;
} }
static FORCE_INLINE void auditDeleteRecord(SAuditRecord * record) {
if (record) {
taosMemoryFree(record->detail);
taosMemoryFree(record);
}
}
void auditCleanup() { void auditCleanup() {
tsLogFp = NULL; tsLogFp = NULL;
taosArrayDestroy(tsAudit.records); taosThreadMutexLock(&tsAudit.lock);
taosArrayDestroyP(tsAudit.records, (FDelete)auditDeleteRecord);
taosThreadMutexUnlock(&tsAudit.lock);
tsAudit.records = NULL; tsAudit.records = NULL;
taosThreadMutexDestroy(&tsAudit.lock); taosThreadMutexDestroy(&tsAudit.lock);
} }