diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-04-07 01:39:14 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-04-13 22:41:47 -0400 |
commit | 634ba33b5b1fcfd5a0e7910f9991b4ed4f674549 (patch) | |
tree | e5652b70e3e62b52cdc17546cc483ab38ba2d8f2 | |
parent | bc11545a1b5c22fe74fc954e26e8a8e9d7cfa39e (diff) |
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.
-rw-r--r-- | pixman/pixman-compiler.h | 2 |
1 files changed, 1 insertions, 1 deletions
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; \ |