From: Ruben Kerkhof Date: Fri, 1 Apr 2016 14:29:53 +0000 (+0200) Subject: gmond: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~38 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=030e6c6c9249cfc3e64b923f3f08611cf4559c96;p=collectd.git gmond: malloc + memset -> calloc --- diff --git a/src/gmond.c b/src/gmond.c index 9b5ceb76..c763cd96 100644 --- a/src/gmond.c +++ b/src/gmond.c @@ -454,10 +454,9 @@ static staging_entry_t *staging_entry_get (const char *host, /* {{{ */ return (se); /* insert new entry */ - se = malloc (sizeof (*se)); + se = calloc (1, sizeof (*se)); if (se == NULL) return (NULL); - memset (se, 0, sizeof (*se)); sstrncpy (se->key, key, sizeof (se->key)); se->flags = 0;