From abb928f60b022d56f5ba80e971632e4ab2e43eec Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 19 Jan 2018 15:10:31 +0100 Subject: [PATCH] service_stop(): Also stop any pending restart timers In service_stop() we call svc_del() which, as of Finit v3.1, free():s the svc_t, so we don't want any lingering restart timers to wake up after free() and start dereferencing the svc_t. Signed-off-by: Joachim Nilsson --- src/service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index ac27ed5d..a7b39cd1 100644 --- a/src/service.c +++ b/src/service.c @@ -429,8 +429,9 @@ static int service_stop(svc_t *svc) if (do_progress) print_result(0); return 0; - } + } else #endif + service_timeout_cancel(svc); if (svc->pid <= 1) { _d("Bad PID %d for %s, SIGTERM", svc->pid, svc->cmd);