Fix a couple of minor memory leaks
These fixes are needed for the test suite to pass when compiled with Address Sanitizer.
This commit is contained in:
parent
7441dbec03
commit
ea26c5e9f8
|
@ -1173,6 +1173,7 @@ FcDirCacheLock (const FcChar8 *dir,
|
||||||
if (!cache_hashed)
|
if (!cache_hashed)
|
||||||
break;
|
break;
|
||||||
fd = FcOpen ((const char *)cache_hashed, O_RDWR);
|
fd = FcOpen ((const char *)cache_hashed, O_RDWR);
|
||||||
|
FcStrFree (cache_hashed);
|
||||||
/* No caches in that directory. simply retry with another one */
|
/* No caches in that directory. simply retry with another one */
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
{
|
{
|
||||||
|
@ -1196,6 +1197,7 @@ FcDirCacheLock (const FcChar8 *dir,
|
||||||
FcStrListDone (list);
|
FcStrListDone (list);
|
||||||
return fd;
|
return fd;
|
||||||
bail:
|
bail:
|
||||||
|
FcStrListDone (list);
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
close (fd);
|
close (fd);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -34,5 +34,7 @@ main (void)
|
||||||
FcConfigAppFontAddFile (config, (const FcChar8 *)"/dev/null"))
|
FcConfigAppFontAddFile (config, (const FcChar8 *)"/dev/null"))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
FcConfigDestroy (config);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue