fix: fix memory leak.

This commit is contained in:
Haojun Liao 2024-11-10 10:49:31 +08:00
parent 9ff749be73
commit 4b50edccf0
1 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,8 @@ int32_t taosGetPIdByName(const char* name, int32_t* pPId) {
} }
} }
closedir(dir);
if ((*pPId) == -1) { if ((*pPId) == -1) {
return TAOS_SYSTEM_ERROR(ESRCH); return TAOS_SYSTEM_ERROR(ESRCH);
} else { } else {