summaryrefslogtreecommitdiff
path: root/src/rc/runscript.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-21 20:02:10 +0000
committerRoy Marples <roy@marples.name>2008-03-21 20:02:10 +0000
commita4f9eb699b915c90ac93a4a9af4de5456085c26c (patch)
tree0c02451b335a934f44251d643d98af0a9e69040d /src/rc/runscript.c
parentf7f3b6ae093106e0f86556d1424af30e2122192a (diff)
downloadopenrc-a4f9eb699b915c90ac93a4a9af4de5456085c26c.tar.gz
openrc-a4f9eb699b915c90ac93a4a9af4de5456085c26c.tar.bz2
openrc-a4f9eb699b915c90ac93a4a9af4de5456085c26c.tar.xz
Fix some crashers in a prefix with few services.
Diffstat (limited to 'src/rc/runscript.c')
-rw-r--r--src/rc/runscript.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index d450004..6174615 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -1255,12 +1255,13 @@ int runscript(int argc, char **argv)
runlevel, depoptions);
rc_stringlist_free(tmplist);
tmplist = NULL;
- TAILQ_FOREACH(svc, services, entries)
- printf("%s ", svc->value);
- if (TAILQ_FIRST(services))
+ if (services) {
+ TAILQ_FOREACH(svc, services, entries)
+ printf("%s ", svc->value);
printf ("\n");
- rc_stringlist_free(services);
- services = NULL;
+ rc_stringlist_free(services);
+ services = NULL;
+ }
} else if (strcmp (optarg, "status") == 0) {
RC_SERVICE r = svc_status();
retval = (int) r;