Skip to content

Commit 5ffa1c7

Browse files
committed
librc: fix resource leaks
1 parent 026472c commit 5ffa1c7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/librc/librc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,11 @@ rc_services_in_runlevel(const char *runlevel)
947947

948948
#ifdef RC_PKG_INITDIR
949949
TAILQ_CONCAT(list, pkg, entries);
950+
rc_stringlist_free(pkg);
950951
#endif
951952
#ifdef RC_LOCAL_INITDIR
952953
TAILQ_CONCAT(list, local, entries);
954+
rc_stringlist_free(local);
953955
#endif
954956
return list;
955957
}
@@ -1007,6 +1009,7 @@ rc_services_in_state(RC_SERVICE state)
10071009
services = ls_dir(dir, LS_INITD);
10081010
if (services) {
10091011
TAILQ_CONCAT(list, services, entries);
1012+
rc_stringlist_free(services);
10101013
}
10111014
}
10121015
rc_stringlist_free(dirs);

0 commit comments

Comments
 (0)