1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Prevent a memory leak

When a CAP DEL is received the key/val pair is not stored in the
hashtable at all so just free them when we're done.
This commit is contained in:
LemonBoy 2017-10-23 21:19:51 +02:00
parent 74409aa850
commit cd107deb46

View File

@ -266,6 +266,10 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
/* The server removed this CAP, remove it from the list /* The server removed this CAP, remove it from the list
* of the active ones if we had requested it */ * of the active ones if we had requested it */
server->cap_active = gslist_delete_string(server->cap_active, key, g_free); server->cap_active = gslist_delete_string(server->cap_active, key, g_free);
/* We don't transfer the ownership of those two
* variables this time, just free them when we're done. */
g_free(key);
g_free(val);
} }
} }
else { else {