From 0347f01345459a506d606002e6a0da29d8bcb77a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 24 Mar 2008 13:30:24 +0000 Subject: Fix segfault when no coldplugged services, thanks to Daijo. --- src/rc/rc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/rc') diff --git a/src/rc/rc.c b/src/rc/rc.c index ff8995b2..f5cd1dd7 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -632,8 +632,9 @@ static void do_coldplug(void) /* Load our list of coldplugged services and display them */ einfon("Device initiated services:%s", ecolor(ECOLOR_HILITE)); coldplugged_services = rc_services_in_state(RC_SERVICE_COLDPLUGGED); - TAILQ_FOREACH(s, coldplugged_services, entries) - printf(" %s", s->value); + if (coldplugged_services) + TAILQ_FOREACH(s, coldplugged_services, entries) + printf(" %s", s->value); printf ("%s\n", ecolor(ECOLOR_NORMAL)); } -- cgit v1.2.3