summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-mode.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-12-25 16:58:18 +0100
committerSebastien Helleu <flashcode@flashtux.org>2012-12-25 16:58:18 +0100
commit45d5034ea018e4a47fc48259ece503b08c63ba38 (patch)
tree19e833f0e3b3eaa8ff65405e2f32203fa818fe2c /src/plugins/irc/irc-mode.c
parent9a024f3abadd4b5aacb4793d5edca7827661d468 (diff)
downloadweechat-45d5034ea018e4a47fc48259ece503b08c63ba38.zip
irc: fix memory leak when updating modes of channel
Diffstat (limited to 'src/plugins/irc/irc-mode.c')
-rw-r--r--src/plugins/irc/irc-mode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c
index 1ea11679b..62491c986 100644
--- a/src/plugins/irc/irc-mode.c
+++ b/src/plugins/irc/irc-mode.c
@@ -241,7 +241,7 @@ irc_mode_channel_update (struct t_irc_server *server,
snprintf (str_temp, length, "%s %s", new_modes, new_args);
if (channel->modes)
free (channel->modes);
- channel->modes = strdup (str_temp);
+ channel->modes = str_temp;
}
}
else
@@ -250,11 +250,12 @@ irc_mode_channel_update (struct t_irc_server *server,
free (channel->modes);
channel->modes = strdup (new_modes);
}
+ }
+ if (new_modes)
free (new_modes);
+ if (new_args)
free (new_args);
- }
-
if (str_modes)
free (str_modes);
if (argv)