diff options
author | Sam James <sam@gentoo.org> | 2022-03-31 07:11:50 +0100 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2022-05-08 14:56:26 -0500 |
commit | 1afcc37803dc9bde0cc8f336fe1f42e2f971ef14 (patch) | |
tree | d6c51d43a9fd73dd70ea8a5324810a7b21638ab8 | |
parent | c4f8b1559ce5b17db331e289fe0fccfcbf41d93a (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>
-rw-r--r-- | src/librc/librc.c | 2 |
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; } |