|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From 09220715e259bf23cbe33d497ed92259a9670320 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From: Andreas Henriksson <andreas@fatal.se>
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Date: Fri, 13 Jun 2014 18:48:18 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Subject: [PATCH] install: fix invalid free() in unit_file_mask()
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
int unit_file_mask(...) in ./src/shared/install.c calls
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
get_config_path(...) which can in 4 error cases return without setting
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
"ret", and thus "prefix" can be uninitialized when unit_file_mask(...)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
finishes (which it does directly after the error is returned from
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
get_config_path(...)).
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
(cherry picked from commit 223217749e57996336d5730b0a28716cca56d45d)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
src/shared/install.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
diff --git a/src/shared/install.c b/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
index 487d0f66..f5620633 100644
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
--- a/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+++ b/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
@@ -563,7 +563,7 @@ int unit_file_mask(
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
unsigned *n_changes) {
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
char **i;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
- _cleanup_free_ char *prefix;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ _cleanup_free_ char *prefix = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
int r;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
assert(scope >= 0);
|