From 75275a04a36dba53a261e208d1ad44780c2a5702 Mon Sep 17 00:00:00 2001 From: Pavel Reichl Date: Mon, 2 Dec 2013 15:49:04 +0000 Subject: monitor: memory-leak bug In case *mt_svc_restart* event can't be created free *svc* directly. --- src/monitor/monitor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/monitor') diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 4c0c22ce9..a99cdfe87 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2626,9 +2626,11 @@ static void mt_svc_exit_handler(int pid, int wait_status, void *pvt) tv = tevent_timeval_current_ofs(restart_delay, 0); te = tevent_add_timer(svc->mt_ctx->ev, svc, tv, mt_svc_restart, svc); - if (!te) { + if (te == NULL) { /* Nothing much we can do */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, + ("Failed to allocate timed event: mt_svc_restart.\n")); + talloc_free(svc); return; } } -- cgit