Merge pull request #20027 from taosdata/fix/TS-2658-MAIN

fix: free thread save memory before set null
This commit is contained in:
Hui Li 2023-02-20 09:35:27 +08:00 committed by GitHub
commit 12d983074f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -788,6 +788,9 @@ int writeVarNames(int type, TAOS_RES* tres) {
void setThreadNull(int type) {
taosThreadMutexLock(&tiresMutex);
if(threads[type]) {
taosMemoryFree(threads[type]);
}
threads[type] = NULL;
taosThreadMutexUnlock(&tiresMutex);
}