From f35b2b385551bb48459fb3e513377d6ae97ace96 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Apr 2016 18:04:51 +0200 Subject: [PATCH] pinba plugin: malloc + memset -> calloc --- src/pinba.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pinba.c b/src/pinba.c index d13d047b..f6ddcdaf 100644 --- a/src/pinba.c +++ b/src/pinba.c @@ -381,14 +381,13 @@ static pinba_socket_t *pinba_socket_open (const char *node, /* {{{ */ } assert (ai_list != NULL); - s = malloc (sizeof (*s)); + s = calloc (1, sizeof (*s)); if (s == NULL) { freeaddrinfo (ai_list); - ERROR ("pinba plugin: malloc failed."); + ERROR ("pinba plugin: calloc failed."); return (NULL); } - memset (s, 0, sizeof (*s)); for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next) { -- 2.30.2