1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00

Merge branch 'fix-double-cap' into 'master'

fix use after free receiving caps

See merge request irssi/irssi!35
This commit is contained in:
ailin-nemui 2019-08-29 17:31:27 +02:00
commit 401fff7c34

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);
}
}