diff options
author | Chengwei Yang <chengwei.yang@intel.com> | 2013-06-27 09:13:57 +0800 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-05 14:01:46 +0100 |
commit | fbeac8820acc60e3400a0a391c10b6c2bba7e8ba (patch) | |
tree | af01364a3ccaab9dc7f3564ce8d3dc208ca2dc98 /tools | |
parent | 3357f484e07e0d6646ef060b25e0fcb3e3781d46 (diff) | |
download | dbus-fbeac8820acc60e3400a0a391c10b6c2bba7e8ba.tar.gz |
dbus-launch: unconditionally use SIGHUP and free memory on OOM
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dbus-launch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index ea24f5ce..15249759 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -451,9 +451,7 @@ signal_handler (int sig) { switch (sig) { -#ifdef SIGHUP case SIGHUP: -#endif case SIGINT: case SIGTERM: got_sighup = TRUE; @@ -769,7 +767,11 @@ pass_info (const char *runprog, const char *bus_address, pid_t bus_pid, 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; |