fix use after free receiving caps

fixes GL#34

(cherry picked from commit 5a4e7ab659aba2855895c9f43e9a7a131f4e89b3)
This commit is contained in:
ailin-nemui 2019-08-27 23:33:51 +02:00
parent 248a1591a2
commit 5b923493de

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,
@ -252,7 +252,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);
}
}