summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2014-09-16 21:22:59 +0200
committerDaniel Mack <daniel@zonque.org>2014-09-16 21:49:03 +0200
commit91e7bad45dced1cb2dfaac79337bb08d6e2b74a9 (patch)
tree30fcc214941a2a1a08995e93688a38aa48f972b6
parentaa9f8a30fd7dc7aa3aa2575b75b3f9a0ab3f02db (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.c2
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;