diff options
author | Eric Leblond <eric@regit.org> | 2013-03-17 21:43:51 +0100 |
---|---|---|
committer | Eric Leblond <eric@regit.org> | 2013-04-20 11:36:45 +0200 |
commit | 8ab0e12641c15e257098963cf10b2c6073aa4e21 (patch) | |
tree | 8b8fd52f7bb0f08b0aab6eb072e469f70f9e8141 /output/pgsql/ulogd_output_PGSQL.c | |
parent | 51ba7aec8951ee86b6872e751837fa884361945b (diff) |
postgresql: add sanity checking
Clean postgresql handler at deinit.
Diffstat (limited to 'output/pgsql/ulogd_output_PGSQL.c')
-rw-r--r-- | output/pgsql/ulogd_output_PGSQL.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |