1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

core: fix memory leak when using multiple "-d" or "-r" in command line arguments

This commit is contained in:
Sébastien Helleu
2015-12-23 07:17:37 +01:00
parent cb23d0166a
commit 841444b68c
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -191,7 +191,11 @@ weechat_parse_args (int argc, char *argv[])
|| (strcmp (argv[i], "--dir") == 0))
{
if (i + 1 < argc)
{
if (weechat_home)
free (weechat_home);
weechat_home = strdup (argv[++i]);
}
else
{
string_iconv_fprintf (stderr,
@@ -255,7 +259,11 @@ weechat_parse_args (int argc, char *argv[])
|| (strcmp (argv[i], "--run-command") == 0))
{
if (i + 1 < argc)
{
if (weechat_startup_commands)
free (weechat_startup_commands);
weechat_startup_commands = strdup (argv[++i]);
}
else
{
string_iconv_fprintf (stderr,