In a previous patch, it check SIGHUP for windows, however, in fact there
is dbus-launch-win.c supposed to be used on windows. So just use SIGHUP
unconditionally.
Also free memory on OOM, although this doesn't make much sense since
this is a oneshort program, rather than a daemon.
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[fixed whitespace -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66068
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
{
switch (sig)
{
-#ifdef SIGHUP
case SIGHUP:
-#endif
case SIGINT:
case SIGTERM:
got_sighup = TRUE;
size_t len = strlen (argv[remaining_args+i-1])+1;
args[i] = malloc (len);
if (!args[i])
- goto oom;
+ {
+ while (i > 1)
+ free (args[--i]);
+ goto oom;
+ }
strncpy (args[i], argv[remaining_args+i-1], len);
}
args[i] = NULL;