mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 18:08:01 +02:00
CID 54766: Resource leak (RESOURCE_LEAK).
Variable original_argv going out of scope leaks the storage it points to. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
718843d351
commit
54f92110f6
1 changed files with 5 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ test_command_line (const char *arg1, ...)
|
|||
if (!_dbus_shell_parse_argv (command_line, &shell_argc, &shell_argv, &error))
|
||||
{
|
||||
fprintf (stderr, "Error parsing command line: %s\n", error.message ? error.message : "");
|
||||
dbus_free (original_argv);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
|
|
@ -60,6 +61,7 @@ test_command_line (const char *arg1, ...)
|
|||
{
|
||||
printf ("Number of arguments returned (%d) don't match original (%d)\n",
|
||||
shell_argc, original_argc);
|
||||
dbus_free (original_argv);
|
||||
return FALSE;
|
||||
}
|
||||
printf ("Number of arguments: %d\n", shell_argc);
|
||||
|
|
@ -74,6 +76,7 @@ test_command_line (const char *arg1, ...)
|
|||
printf ("Position %d, returned argument (%s) does not match original (%s)\n",
|
||||
i, shell_argv[i], unquoted);
|
||||
dbus_free (unquoted);
|
||||
dbus_free (original_argv);
|
||||
return FALSE;
|
||||
}
|
||||
dbus_free (unquoted);
|
||||
|
|
@ -85,7 +88,8 @@ test_command_line (const char *arg1, ...)
|
|||
}
|
||||
|
||||
_dbus_string_free (&str);
|
||||
|
||||
dbus_free (original_argv);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue