aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcpat.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-29 07:22:59 +0000
committermarha <marha@users.sourceforge.net>2011-03-29 07:22:59 +0000
commit2ed8e0e263e27934ba97c00d4820dab5ec08b548 (patch)
tree8ec0340f8100b6824afc3592a586b97d669f0256 /fontconfig/src/fcpat.c
parent87027d4d788c04d3f721b27eb718207bbf30f61c (diff)
parent24abc56b37a3ec32a03b7eafccd96607ae13ea89 (diff)
downloadvcxsrv-2ed8e0e263e27934ba97c00d4820dab5ec08b548.tar.gz
vcxsrv-2ed8e0e263e27934ba97c00d4820dab5ec08b548.tar.bz2
vcxsrv-2ed8e0e263e27934ba97c00d4820dab5ec08b548.zip
svn merge ^/branches/released .
Diffstat (limited to 'fontconfig/src/fcpat.c')
-rw-r--r--fontconfig/src/fcpat.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fontconfig/src/fcpat.c b/fontconfig/src/fcpat.c
index 0fb2e506c..0d2402043 100644
--- a/fontconfig/src/fcpat.c
+++ b/fontconfig/src/fcpat.c
@@ -1057,9 +1057,13 @@ FcStrStaticName (const FcChar8 *name)
if (b->hash == hash && !strcmp ((char *)name, (char *) (b + 1)))
return (FcChar8 *) (b + 1);
size = sizeof (struct objectBucket) + strlen ((char *)name) + 1;
- b = malloc (size + sizeof (int));
- /* workaround glibc bug which reads strlen in groups of 4 */
- FcMemAlloc (FC_MEM_STATICSTR, size + sizeof (int));
+ /*
+ * 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;
+ b = malloc (size);
+ FcMemAlloc (FC_MEM_STATICSTR, size);
if (!b)
return NULL;
b->next = 0;