aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src/fcxml.c')
-rw-r--r--fontconfig/src/fcxml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index d92cbcc66..5201b3c04 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -1359,6 +1359,7 @@ FcParseRange (FcConfigParse *parse)
break;
default:
FcConfigMessage (parse, FcSevereError, "invalid element in range");
+ n = 0;
break;
}
if (count == 1)
@@ -1864,12 +1865,14 @@ FcParseDir (FcConfigParse *parse)
size_t plen = strlen ((const char *)prefix);
size_t dlen = strlen ((const char *)data);
+ FcMemFree (FC_MEM_STRING, plen + 1);
prefix = realloc (prefix, plen + 1 + dlen + 1);
if (!prefix)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
goto bail;
}
+ FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], data, dlen);
prefix[plen + 1 + dlen] = 0;
@@ -1934,7 +1937,7 @@ FcParseDir (FcConfigParse *parse)
bail:
if (prefix)
- free (prefix);
+ FcStrFree (prefix);
}
static void
@@ -1957,12 +1960,14 @@ FcParseCacheDir (FcConfigParse *parse)
size_t plen = strlen ((const char *)prefix);
size_t dlen = strlen ((const char *)data);
+ FcMemFree (FC_MEM_STRING, plen + 1);
prefix = realloc (prefix, plen + 1 + dlen + 1);
if (!prefix)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
goto bail;
}
+ FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], data, dlen);
prefix[plen + 1 + dlen] = 0;
@@ -2053,12 +2058,14 @@ FcParseInclude (FcConfigParse *parse)
size_t plen = strlen ((const char *)prefix);
size_t dlen = strlen ((const char *)s);
+ FcMemFree (FC_MEM_STRING, plen + 1);
prefix = realloc (prefix, plen + 1 + dlen + 1);
if (!prefix)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
goto bail;
}
+ FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], s, dlen);
prefix[plen + 1 + dlen] = 0;
@@ -2076,7 +2083,7 @@ FcParseInclude (FcConfigParse *parse)
bail:
if (prefix)
- free (prefix);
+ FcStrFree (prefix);
}
typedef struct _FcOpMap {