From ac7b4bd56283ba970c15fadaff15a4dad96fbf69 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 8 Dec 2015 11:49:56 +0100 Subject: [PATCH] postgresql plugin: Remove invalid free(). CID: 37936 --- src/postgresql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postgresql.c b/src/postgresql.c index e613662a..78f6fe57 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -1161,7 +1161,7 @@ static int c_psql_config_writer (oconfig_item_t *ci) writers = tmp; writer = writers + writers_num; - ++writers_num; + memset (writer, 0, sizeof (*writer)); writer->name = sstrdup (ci->values[0].value.string); writer->statement = NULL; @@ -1181,10 +1181,10 @@ static int c_psql_config_writer (oconfig_item_t *ci) if (status != 0) { sfree (writer->statement); sfree (writer->name); - sfree (writer); return status; } + ++writers_num; return 0; } /* c_psql_config_writer */ -- 2.30.2