From 8ab0e12641c15e257098963cf10b2c6073aa4e21 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sun, 17 Mar 2013 21:43:51 +0100 Subject: postgresql: add sanity checking Clean postgresql handler at deinit. --- output/pgsql/ulogd_output_PGSQL.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'output/pgsql') diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c index f246153..88fb765 100644 --- a/output/pgsql/ulogd_output_PGSQL.c +++ b/output/pgsql/ulogd_output_PGSQL.c @@ -214,7 +214,9 @@ static int close_db_pgsql(struct ulogd_pluginstance *upi) { struct pgsql_instance *pi = (struct pgsql_instance *) upi->private; - PQfinish(pi->dbh); + if (pi->dbh) + PQfinish(pi->dbh); + pi->dbh = NULL; return 0; } -- cgit v1.2.3