X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvarnish.c;h=d7da95a35b629a4207597327c6d45f9114221f61;hb=354f9991530248e45207d236eb74c1cc3d5238ef;hp=aee72471a4d6b62d8e8d13266b47e8ff742b34a0;hpb=a82395b57384541152423862bcf44c0db7789641;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);