diff options
author | marha <marha@users.sourceforge.net> | 2012-06-04 09:21:39 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-06-04 09:21:39 +0200 |
commit | 1af6fc1b5d93e54d6674de8b5870448b29f139a7 (patch) | |
tree | 83c0d1097657f08544c154d5ba6c820c1fb67e78 /fontconfig/src/fccfg.c | |
parent | e4580373a81894c451e5933b24906a075828b77e (diff) | |
download | vcxsrv-1af6fc1b5d93e54d6674de8b5870448b29f139a7.tar.gz vcxsrv-1af6fc1b5d93e54d6674de8b5870448b29f139a7.tar.bz2 vcxsrv-1af6fc1b5d93e54d6674de8b5870448b29f139a7.zip |
fontconfig libX11 libXft mesa pixman xserver xkeyboard-config git update 4
May 2012
Diffstat (limited to 'fontconfig/src/fccfg.c')
-rw-r--r-- | fontconfig/src/fccfg.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 5b7249201..b45d74a23 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1698,17 +1698,17 @@ static FcChar8 * FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file) { FcChar8 *path; - int size; + int size, osize; if (!dir) dir = (FcChar8 *) ""; - size = strlen ((char *) dir) + 1 + strlen ((char *) file) + 1; + osize = strlen ((char *) dir) + 1 + strlen ((char *) file) + 1; /* * workaround valgrind warning because glibc takes advantage of how it knows memory is * allocated to implement strlen by reading in groups of 4 */ - size = (size + 3) & ~3; + size = (osize + 3) & ~3; path = malloc (size); if (!path) @@ -1729,11 +1729,12 @@ FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file) #endif strcat ((char *) path, (char *) file); - FcMemAlloc (FC_MEM_STRING, size); + FcMemAlloc (FC_MEM_STRING, osize); if (access ((char *) path, R_OK) == 0) return path; FcStrFree (path); + return 0; } @@ -1853,6 +1854,7 @@ FcConfigXdgCacheHome (void) ret = malloc (len + 7 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 7 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".cache", 7); ret[len + 7] = 0; @@ -1878,6 +1880,7 @@ FcConfigXdgConfigHome (void) ret = malloc (len + 8 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 8 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".config", 8); ret[len + 8] = 0; @@ -1903,6 +1906,7 @@ FcConfigXdgDataHome (void) ret = malloc (len + 13 + 1); if (ret) { + FcMemAlloc (FC_MEM_STRING, len + 13 + 1); memcpy (ret, home, len); memcpy (&ret[len], FC_DIR_SEPARATOR_S ".local" FC_DIR_SEPARATOR_S "share", 13); ret[len + 13] = 0; |