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
|
#ifdef RC_PKG_INITDIR
|
||||||
TAILQ_CONCAT(list, pkg, entries);
|
TAILQ_CONCAT(list, pkg, entries);
|
||||||
free(pkg);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef RC_LOCAL_INITDIR
|
#ifdef RC_LOCAL_INITDIR
|
||||||
TAILQ_CONCAT(list, local, entries);
|
TAILQ_CONCAT(list, local, entries);
|
||||||
free(local);
|
|
||||||
#endif
|
#endif
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user