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.
This commit is contained in:
@@ -146,7 +146,7 @@ static int keyboard_load_and_wait(const char *vc, const char *map, const char *m
|
||||
args[i++] = NULL;
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *cmd;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
|
||||
cmd = strv_join((char**) args, " ");
|
||||
log_debug("Executing \"%s\"...", strnull(cmd));
|
||||
@@ -189,7 +189,7 @@ static int font_load_and_wait(const char *vc, const char *font, const char *map,
|
||||
args[i++] = NULL;
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *cmd;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
|
||||
cmd = strv_join((char**) args, " ");
|
||||
log_debug("Executing \"%s\"...", strnull(cmd));
|
||||
|
||||
Reference in New Issue
Block a user