From: Sebastian Harl Date: Tue, 19 Feb 2013 17:39:46 +0000 (+0100) Subject: utils dbi: Avoid segfault when executing queries when not connected. X-Git-Tag: sysdb-0.1.0~441 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c876991c879f5017288b08f354921f199958180;p=sysdb.git utils dbi: Avoid segfault when executing queries when not connected. Apparently, the libdbi functions don't check for that condition. --- diff --git a/src/utils/dbi.c b/src/utils/dbi.c index ee2280c..ea846b0 100644 --- a/src/utils/dbi.c +++ b/src/utils/dbi.c @@ -355,7 +355,7 @@ sdb_dbi_exec_query(sdb_dbi_client_t *client, const char *query, int status; - if ((! client) || (! query)) + if ((! client) || (! client->conn) || (! query)) return -1; res = dbi_conn_query(client->conn, query);