Commit ea26c5e9 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Akira TAGOH

Fix a couple of minor memory leaks

These fixes are needed for the test suite to pass when compiled
with Address Sanitizer.
parent 7441dbec
......@@ -1173,6 +1173,7 @@ FcDirCacheLock (const FcChar8 *dir,
if (!cache_hashed)
break;
fd = FcOpen ((const char *)cache_hashed, O_RDWR);
FcStrFree (cache_hashed);
/* No caches in that directory. simply retry with another one */
if (fd != -1)
{
......@@ -1196,6 +1197,7 @@ FcDirCacheLock (const FcChar8 *dir,
FcStrListDone (list);
return fd;
bail:
FcStrListDone (list);
if (fd != -1)
close (fd);
return -1;
......
......@@ -34,5 +34,7 @@ main (void)
FcConfigAppFontAddFile (config, (const FcChar8 *)"/dev/null"))
return 1;
FcConfigDestroy (config);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment