This doesn't really do anything, because we're about to exit anyway, but
it placates static analysis tools.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
Bug-NB: NB#180486
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
int binary_syntax,
int argc, char **argv, int remaining_args)
{
+ char *envvar = NULL;
+ char **args = NULL;
+
if (runprog)
{
- char *envvar;
- char **args;
int i;
envvar = malloc (strlen ("DBUS_SESSION_BUS_ADDRESS=") +
args = malloc (sizeof (char *) * ((argc-remaining_args)+2));
if (envvar == NULL || args == NULL)
- {
- free (envvar);
- free (args);
- goto oom;
- }
+ goto oom;
args[0] = xstrdup (runprog);
if (!args[0])
close (2);
exit (0);
oom:
+ if (envvar)
+ free (envvar);
+
+ if (args)
+ free (args);
+
fprintf (stderr, "Out of memory!");
exit (1);
}