From 374882386479278f8d693f09ea970861ac6f6375 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:36:46 +0200 Subject: [PATCH] write_http plugin: malloc + memset -> calloc --- src/write_http.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/write_http.c b/src/write_http.c index ec3a01ce..14ce0ec7 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -549,13 +549,12 @@ static int wh_config_node (oconfig_item_t *ci) /* {{{ */ int status = 0; int i; - cb = malloc (sizeof (*cb)); + cb = calloc (1, sizeof (*cb)); if (cb == NULL) { - ERROR ("write_http plugin: malloc failed."); + ERROR ("write_http plugin: calloc failed."); return (-1); } - memset (cb, 0, sizeof (*cb)); cb->verify_peer = 1; cb->verify_host = 1; cb->format = WH_FORMAT_COMMAND; -- 2.11.0