mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-05 21:21:49 +00:00
sysv-generator: fix resource leak
The "unit" string allocation is not freed on either error or success path. Found by coverity. Fixes: CID#1237755
This commit is contained in:
committed by
Daniel Mack
parent
aa9f8a30fd
commit
91e7bad45d
@@ -114,9 +114,9 @@ static int add_symlink(const char *service, const char *where) {
|
||||
}
|
||||
|
||||
static int generate_unit_file(SysvStub *s) {
|
||||
char *unit;
|
||||
char **p;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
_cleanup_free_ char *unit = NULL;
|
||||
_cleanup_free_ char *before = NULL;
|
||||
_cleanup_free_ char *after = NULL;
|
||||
_cleanup_free_ char *wants = NULL;
|
||||
|
||||
Reference in New Issue
Block a user