Check for NULL before clearing connection data

This commit is contained in:
James Booth
2016-06-01 22:41:17 +01:00
parent 784d9642bc
commit 086fd30e23

View File

@@ -216,11 +216,15 @@ connection_set_disconnected(void)
void void
connection_clear_data(void) connection_clear_data(void)
{ {
if (conn.features_by_jid) {
g_hash_table_destroy(conn.features_by_jid); g_hash_table_destroy(conn.features_by_jid);
conn.features_by_jid = NULL; conn.features_by_jid = NULL;
}
if (conn.available_resources) {
g_hash_table_remove_all(conn.available_resources); g_hash_table_remove_all(conn.available_resources);
} }
}
#ifdef HAVE_LIBMESODE #ifdef HAVE_LIBMESODE
TLSCertificate* TLSCertificate*