aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-31 07:11:50 +0100
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-05-08 14:56:26 -0500
commit1afcc37803dc9bde0cc8f336fe1f42e2f971ef14 (patch)
treed6c51d43a9fd73dd70ea8a5324810a7b21638ab8 /src/librc
parentc4f8b1559ce5b17db331e289fe0fccfcbf41d93a (diff)
librc: fix potential use-after-free
Both 'pkg' and 'local' are referenced within list, so we can't free them yet. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/librc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 51e37aba..027d3fc1 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -947,11 +947,9 @@ rc_services_in_runlevel(const char *runlevel)
#ifdef RC_PKG_INITDIR
TAILQ_CONCAT(list, pkg, entries);
- free(pkg);
#endif
#ifdef RC_LOCAL_INITDIR
TAILQ_CONCAT(list, local, entries);
- free(local);
#endif
return list;
}