From df089f4e06bfb0a33f39211d054393e4af325984 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 5 Oct 2014 18:10:09 +0200 Subject: [PATCH] utils dbi: Guard against multiple calls to dbi_shutdown_r(). This should not happen anyway but better be safe than sorry. --- src/utils/dbi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/dbi.c b/src/utils/dbi.c index 73fc6b7..261d3b2 100644 --- a/src/utils/dbi.c +++ b/src/utils/dbi.c @@ -379,8 +379,7 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client) client->conn = dbi_conn_open(driver); if (! client->conn) { - sdb_log(SDB_LOG_ERR, "dbi: failed to open connection " - "object."); + sdb_log(SDB_LOG_ERR, "dbi: failed to open connection object."); return -1; } @@ -546,7 +545,9 @@ sdb_dbi_client_destroy(sdb_dbi_client_t *client) dbi_conn_close(client->conn); client->conn = NULL; - dbi_shutdown_r(client->inst); + if (client->inst) + dbi_shutdown_r(client->inst); + client->inst = NULL; if (client->options) sdb_dbi_options_destroy(client->options); -- 2.30.2