Fix memory leak

This commit is contained in:
Akira TAGOH 2018-07-19 04:29:01 +00:00
parent 433718fb77
commit 37c9c16dad
1 changed files with 3 additions and 1 deletions

View File

@ -2190,6 +2190,7 @@ FcParseCacheDir (FcConfigParse *parse)
if (!data)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
data = prefix;
goto bail;
}
if (prefix)
@ -2201,7 +2202,7 @@ FcParseCacheDir (FcConfigParse *parse)
if (!p)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
data = prefix;
FcStrFree (prefix);
goto bail;
}
prefix = p;
@ -2233,6 +2234,7 @@ FcParseCacheDir (FcConfigParse *parse)
else if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0)
{
int rc;
FcStrFree (data);
data = malloc (1000);
if (!data)