diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-04-12 23:10:21 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-04-14 12:25:06 +0100 |
commit | c2b2df604b845b4e1697d0911935e6644323c5a6 (patch) | |
tree | 010d290588b55b7ed97f9e3066f56f9a9d08d77d /src/login/logind-session.c | |
parent | be084c0dd1f1a06320e507c0e6a9de23b37556e1 (diff) | |
download | systemd-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/login/logind-session.c')
-rw-r--r-- | src/login/logind-session.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 34fcde92aa..6a3dd860db 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -266,7 +266,7 @@ int session_save(Session *s) { fprintf(f, "DISPLAY=%s\n", s->display); if (s->remote_host) { - _cleanup_free_ char *escaped; + _cleanup_free_ char *escaped = NULL; escaped = cescape(s->remote_host); if (!escaped) { @@ -278,7 +278,7 @@ int session_save(Session *s) { } if (s->remote_user) { - _cleanup_free_ char *escaped; + _cleanup_free_ char *escaped = NULL; escaped = cescape(s->remote_user); if (!escaped) { @@ -290,7 +290,7 @@ int session_save(Session *s) { } if (s->service) { - _cleanup_free_ char *escaped; + _cleanup_free_ char *escaped = NULL; escaped = cescape(s->service); if (!escaped) { @@ -302,7 +302,7 @@ int session_save(Session *s) { } if (s->desktop) { - _cleanup_free_ char *escaped; + _cleanup_free_ char *escaped = NULL; escaped = cescape(s->desktop); if (!escaped) { |