summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2014-06-13 18:48:18 +0200
committerTom Gundersen <teg@jklm.no>2014-06-13 19:01:07 +0200
commit223217749e57996336d5730b0a28716cca56d45d (patch)
tree781b4582499a5cf67c41a4a07f5e1bc1e30d7b3d
parentf8a0bb5285024b6ce372c3157e761e6543ebdcd2 (diff)
install: fix invalid free() in unit_file_mask()
int unit_file_mask(...) in ./src/shared/install.c calls get_config_path(...) which can in 4 error cases return without setting "ret", and thus "prefix" can be uninitialized when unit_file_mask(...) finishes (which it does directly after the error is returned from get_config_path(...)).
-rw-r--r--src/shared/install.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index 487d0f660d..f5620633c0 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -563,7 +563,7 @@ int unit_file_mask(
unsigned *n_changes) {
char **i;
- _cleanup_free_ char *prefix;
+ _cleanup_free_ char *prefix = NULL;
int r;
assert(scope >= 0);