summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorPavel Reichl <pavel.reichl@redhat.com>2013-12-02 14:51:59 +0000
committerJakub Hrozek <jhrozek@redhat.com>2013-12-09 22:08:53 +0100
commitf89cf190f58f3f5c73758abd0a24974a78cb160b (patch)
tree06ba4c9b313ed47de3d876a2ed5c112f9726b735 /src/monitor
parent9882475d3c59f4750a19953bb7d02edab198c900 (diff)
downloadsssd-f89cf190f58f3f5c73758abd0a24974a78cb160b.tar.gz
sssd-f89cf190f58f3f5c73758abd0a24974a78cb160b.tar.xz
sssd-f89cf190f58f3f5c73758abd0a24974a78cb160b.zip
monitor: use-after-free bugfix
*monitor_kill_service* may create timed event which operates on *svc* and therefore *svc* should not be freed right after call of *monitor_kill_sercice*. *svc* is supposed to be freed by *mt_svc_restart*.
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 92bac422a..5ea4fc930 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -716,7 +716,8 @@ static int service_signal(struct mt_svc *svc, const char *svc_signal)
* order a service to reload that hasn't started
* yet.
*/
- DEBUG(1,("Could not signal service [%s].\n", svc->name));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Could not signal service [%s].\n", svc->name));
return EIO;
}
@@ -724,10 +725,11 @@ static int service_signal(struct mt_svc *svc, const char *svc_signal)
MONITOR_PATH,
MONITOR_INTERFACE,
svc_signal);
- if (!msg) {
- DEBUG(0,("Out of memory?!\n"));
+ if (msg == NULL) {
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ ("Out of memory trying to allocate memory to invoke: %s\n",
+ svc_signal));
monitor_kill_service(svc);
- talloc_free(svc);
return ENOMEM;
}