diff options
author | Andreas Henriksson <andreas@fatal.se> | 2014-09-16 21:22:59 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2014-09-16 21:49:03 +0200 |
commit | 91e7bad45dced1cb2dfaac79337bb08d6e2b74a9 (patch) | |
tree | 30fcc214941a2a1a08995e93688a38aa48f972b6 | |
parent | aa9f8a30fd7dc7aa3aa2575b75b3f9a0ab3f02db (diff) |
sysv-generator: fix resource leak
The "unit" string allocation is not freed on either error or success path.
Found by coverity. Fixes: CID#1237755
-rw-r--r-- | src/sysv-generator/sysv-generator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index 6c3281ff15..e5902ab8f8 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -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; |