Merge pull request #1130 from ailin-nemui/string-free

Only call g_string_free if there is a string

(cherry picked from commit 49c6c2b69f5c7bc579153456d1eecdf03eef715e)
This commit is contained in:
ailin-nemui 2019-10-01 13:55:46 +02:00 committed by Ailin Nemui
parent aae1e3392a
commit 18e97d9e8b

View File

@ -451,7 +451,11 @@ static void sig_destroyed(IRC_SERVER_REC *server)
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free);
server->cap_queue = NULL;
g_free_and_null(server->sasl_buffer);
/* was g_free_and_null, but can't use on a GString */
if (server->sasl_buffer != NULL) {
g_string_free(server->sasl_buffer, TRUE);
server->sasl_buffer = NULL;
}
/* these are dynamically allocated only if isupport was sent */
g_hash_table_foreach(server->isupport,