From: Sebastian Harl Date: Sun, 5 Oct 2014 16:10:09 +0000 (+0200) Subject: utils dbi: Guard against multiple calls to dbi_shutdown_r(). X-Git-Tag: sysdb-0.5.0~15 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=df089f4e06bfb0a33f39211d054393e4af325984 utils dbi: Guard against multiple calls to dbi_shutdown_r(). This should not happen anyway but better be safe than sorry. --- 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);