From 89609e324696790276c494bee774a30e2d9dc3c8 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:33:34 +0200 Subject: [PATCH] varnish plugin: malloc + memset -> calloc --- src/varnish.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 2.30.2