From 1afcc37803dc9bde0cc8f336fe1f42e2f971ef14 Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 31 Mar 2022 07:11:50 +0100 Subject: 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 --- src/librc/librc.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3