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

fix use after free receiving caps

fixes GL#34
This commit is contained in:
ailin-nemui 2019-08-27 23:33:51 +02:00
parent 3f0afa91f3
commit 5a4e7ab659

View File

@ -169,7 +169,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
* duplicated values, let's just warn the user */
g_warning("The server sent the %s capability twice", key);
}
g_hash_table_insert(server->cap_supported, key, val);
g_hash_table_replace(server->cap_supported, key, val);
}
/* A multiline response is always terminated by a normal one,
@ -255,7 +255,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
continue;
}
g_hash_table_insert(server->cap_supported, key, val);
g_hash_table_replace(server->cap_supported, key, val);
cap_emit_signal(server, "new", key);
}
}