Skip to content

Commit

Permalink
librc: fix resource leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
williamh committed May 8, 2022
1 parent 026472c commit 5ffa1c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,9 +947,11 @@ rc_services_in_runlevel(const char *runlevel)

#ifdef RC_PKG_INITDIR
TAILQ_CONCAT(list, pkg, entries);
rc_stringlist_free(pkg);
#endif
#ifdef RC_LOCAL_INITDIR
TAILQ_CONCAT(list, local, entries);
rc_stringlist_free(local);
#endif
return list;
}
Expand Down Expand Up @@ -1007,6 +1009,7 @@ rc_services_in_state(RC_SERVICE state)
services = ls_dir(dir, LS_INITD);
if (services) {
TAILQ_CONCAT(list, services, entries);
rc_stringlist_free(services);
}
}
rc_stringlist_free(dirs);
Expand Down

0 comments on commit 5ffa1c7

Please sign in to comment.