X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_llist.c;h=1a6188f612344fedb41157f035b7159af5528df0;hb=c6557cb8950f50a41a1decfb34439b060e2fd371;hp=4265286bdaf899dcb2bba34e97a712876d5455b0;hpb=21a4ddcc2d66eea59224fd95746c7533b1b1a46d;p=collectd.git diff --git a/src/daemon/utils_llist.c b/src/daemon/utils_llist.c index 4265286b..1a6188f6 100644 --- a/src/daemon/utils_llist.c +++ b/src/daemon/utils_llist.c @@ -48,12 +48,10 @@ llist_t *llist_create (void) { llist_t *ret; - ret = (llist_t *) malloc (sizeof (llist_t)); + ret = calloc (1, sizeof (*ret)); if (ret == NULL) return (NULL); - memset (ret, '\0', sizeof (llist_t)); - return (ret); } @@ -78,7 +76,7 @@ llentry_t *llentry_create (char *key, void *value) { llentry_t *e; - e = (llentry_t *) malloc (sizeof (llentry_t)); + e = malloc (sizeof (*e)); if (e) { e->key = key;