From: Florian Forster Date: Thu, 16 Oct 2008 08:05:31 +0000 (+0200) Subject: postgresql plugin: Add a couple of PQclear() calls. X-Git-Tag: collectd-4.5.1~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=4cca3a1b70c8320c613bb249664a3a9f879ff8d5;p=collectd.git postgresql plugin: Add a couple of PQclear() calls. The postgresql plugin is missing a couple of PQclear() calls Thanks to Admin for pointing this out. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/postgresql.c b/src/postgresql.c index 9438c576..9959690a 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -417,8 +417,10 @@ static int c_psql_exec_query (c_psql_database_t *db, int idx) } rows = PQntuples (res); - if (1 > rows) + if (1 > rows) { + PQclear (res); return 0; + } cols = PQnfields (res); if (query->cols_num != cols) { @@ -442,6 +444,7 @@ static int c_psql_exec_query (c_psql_database_t *db, int idx) submit_gauge (db, col.type, col.type_instance, value); } } + PQclear (res); return 0; } /* c_psql_exec_query */