summaryrefslogtreecommitdiff
path: root/src/activate
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-04-12 23:10:21 +0100
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-04-14 12:25:06 +0100
commitc2b2df604b845b4e1697d0911935e6644323c5a6 (patch)
tree010d290588b55b7ed97f9e3066f56f9a9d08d77d /src/activate
parentbe084c0dd1f1a06320e507c0e6a9de23b37556e1 (diff)
downloadsystemd-c2b2df604b845b4e1697d0911935e6644323c5a6.tar.gz
tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
Diffstat (limited to 'src/activate')
-rw-r--r--src/activate/activate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index f298b1d491..8c61c3ca7f 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -151,7 +151,7 @@ static int exec_process(const char *name, char **argv, char **env, int start_fd,
envp[n_env++] = k;
} else {
- _cleanup_free_ char *p;
+ _cleanup_free_ char *p = NULL;
const char *n;
p = strjoin(*s, "=");
@@ -421,7 +421,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_FDNAME: {
- _cleanup_strv_free_ char **names;
+ _cleanup_strv_free_ char **names = NULL;
char **s;
names = strv_split(optarg, ":");
@@ -430,7 +430,7 @@ static int parse_argv(int argc, char *argv[]) {
STRV_FOREACH(s, names)
if (!fdname_is_valid(*s)) {
- _cleanup_free_ char *esc;
+ _cleanup_free_ char *esc = NULL;
esc = cescape(*s);
log_warning("File descriptor name \"%s\" is not valid.", esc);