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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user