From 086fd30e2399dcca8a75a71f0bac4a8852f2de46 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 1 Jun 2016 22:41:17 +0100 Subject: Check for NULL before clearing connection data --- src/xmpp/connection.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index ffabc149..07b528ef 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -216,10 +216,14 @@ connection_set_disconnected(void) void connection_clear_data(void) { - g_hash_table_destroy(conn.features_by_jid); - conn.features_by_jid = NULL; + if (conn.features_by_jid) { + g_hash_table_destroy(conn.features_by_jid); + conn.features_by_jid = NULL; + } - g_hash_table_remove_all(conn.available_resources); + if (conn.available_resources) { + g_hash_table_remove_all(conn.available_resources); + } } #ifdef HAVE_LIBMESODE -- cgit 1.4.1-2-gfad0