From: Søren Sandmann Pedersen Date: Wed, 7 Apr 2010 05:39:14 +0000 (-0400) Subject: Fix uninitialized cache when pthreads are used X-Git-Tag: 1.0_branch~592 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=634ba33b5b1fcfd5a0e7910f9991b4ed4f674549;p=profile%2Fivi%2Fpixman.git Fix uninitialized cache when pthreads are used The thread local cache is allocated with malloc(), but we rely on it being initialized to zero, so allocate it with calloc() instead. --- diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h index a4e3f88..cdac0d8 100644 --- a/pixman/pixman-compiler.h +++ b/pixman/pixman-compiler.h @@ -101,7 +101,7 @@ static type * \ tls_ ## name ## _alloc (key) \ { \ - type *value = malloc (sizeof (type)); \ + type *value = calloc (1, sizeof (type)); \ if (value) \ pthread_setspecific (key, value); \ return value; \