X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvarnish.c;h=d7da95a35b629a4207597327c6d45f9114221f61;hb=edd9af8a874ebc9f2a7f02846807229a648917db;hp=aee72471a4d6b62d8e8d13266b47e8ff742b34a0;hpb=029e88709f60d90fede55ed31f775602c1487d24;p=collectd.git diff --git a/src/varnish.c b/src/varnish.c index aee72471..d7da95a3 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -943,10 +943,9 @@ static int varnish_init (void) /* {{{ */ if (have_instance) return (0); - conf = malloc (sizeof (*conf)); + conf = calloc (1, sizeof (*conf)); if (conf == NULL) return (ENOMEM); - memset (conf, 0, sizeof (*conf)); /* Default settings: */ conf->instance = NULL; @@ -972,10 +971,9 @@ static int varnish_config_instance (const oconfig_item_t *ci) /* {{{ */ char callback_name[DATA_MAX_NAME_LEN]; int i; - conf = malloc (sizeof (*conf)); + conf = calloc (1, sizeof (*conf)); if (conf == NULL) return (ENOMEM); - memset (conf, 0, sizeof (*conf)); conf->instance = NULL; varnish_config_apply_default (conf);