summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2014-12-09 22:58:36 +0100
committerDavid Henningsson <david.henningsson@canonical.com>2014-12-10 14:28:45 +0100
commit9e65fd137364d67f06168a260f7ab192536c85f5 (patch)
treed659ae96d40349a3555619441e51be2dfc4d6b44
parente175796fa5a799dfdb71c928fedada5fac315e9c (diff)
memblock: Initialize mempool object to zero
This fixes a "use of uninitialised value" error in previous memblock commit. Reported-by: Alexander Patrakov <patrakov@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r--src/pulsecore/memblock.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index eb85d1f16..b78131228 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -751,7 +751,7 @@ pa_mempool* pa_mempool_new(bool shared, size_t size) {
pa_mempool *p;
char t1[PA_BYTES_SNPRINT_MAX], t2[PA_BYTES_SNPRINT_MAX];
- p = pa_xnew(pa_mempool, 1);
+ p = pa_xnew0(pa_mempool, 1);
p->block_size = PA_PAGE_ALIGN(PA_MEMPOOL_SLOT_SIZE);
if (p->block_size < PA_PAGE_SIZE)
@@ -778,7 +778,6 @@ pa_mempool* pa_mempool_new(bool shared, size_t size) {
pa_bytes_snprint(t2, sizeof(t2), (unsigned) (p->n_blocks * p->block_size)),
(unsigned long) pa_mempool_block_size_max(p));
- memset(&p->stat, 0, sizeof(p->stat));
pa_atomic_store(&p->n_init, 0);
PA_LLIST_HEAD_INIT(pa_memimport, p->imports);