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:
@@ -576,7 +576,7 @@ end:
|
||||
|
||||
/* Removing empty dropin dirs */
|
||||
if (!arg_full) {
|
||||
_cleanup_free_ char *dir;
|
||||
_cleanup_free_ char *dir = NULL;
|
||||
|
||||
dir = dirname_malloc(*original);
|
||||
if (!dir)
|
||||
|
||||
@@ -24,7 +24,7 @@ static int get_unit_list_recursive(
|
||||
char ***ret_machines) {
|
||||
|
||||
_cleanup_free_ UnitInfo *unit_infos = NULL;
|
||||
_cleanup_(message_set_freep) Set *replies;
|
||||
_cleanup_(message_set_freep) Set *replies = NULL;
|
||||
sd_bus_message *reply;
|
||||
int c, r;
|
||||
|
||||
|
||||
@@ -1282,7 +1282,7 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
|
||||
while ((r = exec_status_info_deserialize(m, &info, is_ex_prop)) > 0) {
|
||||
char timestamp1[FORMAT_TIMESTAMP_MAX], timestamp2[FORMAT_TIMESTAMP_MAX];
|
||||
_cleanup_strv_free_ char **optv = NULL;
|
||||
_cleanup_free_ char *tt, *o = NULL;
|
||||
_cleanup_free_ char *tt = NULL, *o = NULL;
|
||||
|
||||
tt = strv_join(info.argv, " ");
|
||||
|
||||
@@ -2129,7 +2129,7 @@ int show(int argc, char *argv[], void *userdata) {
|
||||
return r;
|
||||
|
||||
STRV_FOREACH(name, names) {
|
||||
_cleanup_free_ char *path;
|
||||
_cleanup_free_ char *path = NULL;
|
||||
|
||||
path = unit_dbus_path_from_name(*name);
|
||||
if (!path)
|
||||
|
||||
Reference in New Issue
Block a user