Prevent a UAF error during the execution of some commands

Some arguments were free'd first and then printed, leading to gibberish
being output to screen or a crash.

Found by Joseph Bisch.
Closes: !GL17
This commit is contained in:
LemonBoy 2017-11-11 12:37:51 +01:00
commit 7605f67f95
3 changed files with 3 additions and 3 deletions

View file

@ -106,9 +106,9 @@ static void cmd_network_add_modify(const char *data, gboolean add)
rec = ircnet_find(name);
if (rec == NULL) {
if (add == FALSE) {
cmd_params_free(free_arg);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
IRCTXT_NETWORK_NOT_FOUND, name);
cmd_params_free(free_arg);
return;
}