X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_heap.c;h=ae502c90ea7736a50e65972fc1a1917f7fa833c5;hb=91103db5378a036c0e4da9d512f686d9d0096ff7;hp=1b5dca736ba59da0cf05a81ecf4a336dd378bbca;hpb=81a5fd5046c6a39f580a8fc1a3af837fd5f5aa5c;p=collectd.git diff --git a/src/daemon/utils_heap.c b/src/daemon/utils_heap.c index 1b5dca73..ae502c90 100644 --- a/src/daemon/utils_heap.c +++ b/src/daemon/utils_heap.c @@ -112,14 +112,13 @@ c_heap_t *c_heap_create (int (*compare) (const void *, const void *)) if (compare == NULL) return (NULL); - h = malloc (sizeof (*h)); + h = calloc (1, sizeof (*h)); if (h == NULL) return (NULL); - memset (h, 0, sizeof (*h)); pthread_mutex_init (&h->lock, /* attr = */ NULL); h->compare = compare; - + h->list = NULL; h->list_len = 0; h->list_size = 0;