From: Ruben Kerkhof Date: Fri, 1 Apr 2016 16:36:46 +0000 (+0200) Subject: write_http plugin: malloc + memset -> calloc X-Git-Tag: collectd-5.6.0~371^2~6 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=374882386479278f8d693f09ea970861ac6f6375;p=collectd.git write_http plugin: malloc + memset -> calloc --- 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;