aboutsummaryrefslogtreecommitdiff
path: root/src/rc-status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc-status.c')
-rw-r--r--src/rc-status.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rc-status.c b/src/rc-status.c
index f75bfb83..cd4a24f8 100644
--- a/src/rc-status.c
+++ b/src/rc-status.c
@@ -117,8 +117,11 @@ int rc_status (int argc, char **argv)
while (optind < argc)
rc_strlist_add (&levels, argv[optind++]);
- if (! levels)
- rc_strlist_add (&levels, rc_get_runlevel ());
+ if (! levels) {
+ level = rc_get_runlevel ();
+ rc_strlist_add (&levels, level);
+ free (level);
+ }
STRLIST_FOREACH (levels, level, i) {
print_level (level);