From d667da8e5c4b3de1f73dd288f88ea8783799735b Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 12 May 2008 13:20:35 +0000 Subject: Check we have a deptree before using it, Gentoo #220579 --- src/rc/runscript.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/rc') diff --git a/src/rc/runscript.c b/src/rc/runscript.c index 7b87c27f..e234b766 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -877,11 +877,13 @@ static void svc_start(bool deps) } /* Do the same for any services we provide */ - tmplist = rc_deptree_depend(deptree, "iprovide", applet); - if (tmplist) { - TAILQ_FOREACH(svc, tmplist, entries) { - services = rc_services_scheduled(svc->value); - if (services) { + if (deptree) { + tmplist = rc_deptree_depend(deptree, "iprovide", applet); + if (tmplist) { + TAILQ_FOREACH(svc, tmplist, entries) { + services = rc_services_scheduled(svc->value); + if (! services) + continue; TAILQ_FOREACH(svc2, services, entries) if (rc_service_state(svc2->value) & RC_SERVICE_STOPPED) service_start(svc2->value); -- cgit v1.2.3