summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2017-10-23 21:19:51 +0200
committerLemonBoy <thatlemon@gmail.com>2018-01-07 12:36:20 +0100
commitcd107deb463934f7a8611cdc8d17b861a93d97f9 (patch)
treea711d397cd4bd0fc8316e25c09d84237d8e0f243
parent74409aa85071390a3969fffa21c08a6736efe314 (diff)
downloadirssi-cd107deb463934f7a8611cdc8d17b861a93d97f9.zip
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.
-rw-r--r--src/irc/core/irc-cap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/irc/core/irc-cap.c b/src/irc/core/irc-cap.c
index 9af55130..8be9d33f 100644
--- a/src/irc/core/irc-cap.c
+++ b/src/irc/core/irc-cap.c
@@ -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
* of the active ones if we had requested it */
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 {