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>
This commit is contained in:
parent
c4f8b1559c
commit
1afcc37803
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user