aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcxml.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-12-10 08:55:36 +0100
committermarha <marha@users.sourceforge.net>2012-12-10 08:55:36 +0100
commita0124a5e8e70979d2c24ef55285da989fdad766a (patch)
tree5cea5c9804a8edf67bc7260e0851a20d21324547 /fontconfig/src/fcxml.c
parent514b4afb64ccbf8e954270105ed5064272a2be68 (diff)
parent0328076efb5ff6e62152c09e38d0d11f7931d07b (diff)
downloadvcxsrv-a0124a5e8e70979d2c24ef55285da989fdad766a.tar.gz
vcxsrv-a0124a5e8e70979d2c24ef55285da989fdad766a.tar.bz2
vcxsrv-a0124a5e8e70979d2c24ef55285da989fdad766a.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libX11 mesa pixman git update 10 dec 2012 Conflicts: fontconfig/src/fcxml.c
Diffstat (limited to 'fontconfig/src/fcxml.c')
-rwxr-xr-x[-rw-r--r--]fontconfig/src/fcxml.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index 7d1d6f1ad..0c8c80561 100644..100755
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -1850,7 +1850,7 @@ FcParseDir (FcConfigParse *parse)
{
const FcChar8 *attr;
FcChar8 *data;
- FcChar8 *prefix = NULL;
+ FcChar8 *prefix = NULL, *p;
#ifdef _WIN32
FcChar8 buffer[1000];
#endif
@@ -1869,13 +1869,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)
+ p = realloc (prefix, plen + 1 + dlen + 1);
+ if (!p)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
goto bail;
}
+ prefix = p;
+ FcMemFree (FC_MEM_STRING, plen + 1);
FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], data, dlen);
@@ -1948,7 +1949,7 @@ static void
FcParseCacheDir (FcConfigParse *parse)
{
const FcChar8 *attr;
- FcChar8 *prefix = NULL, *data;
+ FcChar8 *prefix = NULL, *p, *data;
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
@@ -1964,13 +1965,15 @@ 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)
+ p = realloc (prefix, plen + 1 + dlen + 1);
+ if (!p)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
+ data = prefix;
goto bail;
}
+ prefix = p;
+ FcMemFree (FC_MEM_STRING, plen + 1);
FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], data, dlen);
@@ -2044,7 +2047,7 @@ FcParseInclude (FcConfigParse *parse)
const FcChar8 *attr;
FcBool ignore_missing = FcFalse;
FcBool deprecated = FcFalse;
- FcChar8 *prefix = NULL;
+ FcChar8 *prefix = NULL, *p;
s = FcStrBufDoneStatic (&parse->pstack->str);
if (!s)
@@ -2066,13 +2069,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)
+ p = realloc (prefix, plen + 1 + dlen + 1);
+ if (!p)
{
FcConfigMessage (parse, FcSevereError, "out of memory");
goto bail;
}
+ prefix = p;
+ FcMemFree (FC_MEM_STRING, plen + 1);
FcMemAlloc (FC_MEM_STRING, plen + 1 + dlen + 1);
prefix[plen] = FC_DIR_SEPARATOR;
memcpy (&prefix[plen + 1], s, dlen);
@@ -2086,8 +2090,10 @@ FcParseInclude (FcConfigParse *parse)
FcChar8 *filename;
filename = FcConfigFilename(s);
- if ((deprecated == FcTrue) && filename)
- {
+ if (deprecated == FcTrue &&
+ filename != NULL &&
+ !FcFileIsLink (filename))
+ {
FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s);
}
if(filename)