From 24abc56b37a3ec32a03b7eafccd96607ae13ea89 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 29 Mar 2011 06:44:20 +0000 Subject: xserver fontconfig mesa git update 29 Mar 2011 --- fontconfig/src/fcpat.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fontconfig/src/fcpat.c') diff --git a/fontconfig/src/fcpat.c b/fontconfig/src/fcpat.c index be01a4fd2..8f63659df 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; -- cgit v1.2.3