Fix some memory leaks

This commit is contained in:
Linus Dierheimer
2022-09-18 16:30:26 +02:00
parent b4306b944e
commit d079e25a43
5 changed files with 12 additions and 0 deletions
+4
View File
@@ -88,6 +88,7 @@ const FFTempsResult* ffDetectTemps()
DIR* dirp = opendir(baseDir.chars);
if(dirp == NULL)
{
ffStrbufDestroy(&baseDir);
pthread_mutex_unlock(&mutex);
return &result;
}
@@ -114,6 +115,9 @@ const FFTempsResult* ffDetectTemps()
ffStrbufSubstrBefore(&baseDir, baseDirLength);
}
closedir(dirp);
ffStrbufDestroy(&baseDir);
pthread_mutex_unlock(&mutex);
return &result;
}