chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9d5a375
)
hostnamed: modernizations
author
Lennart Poettering
<lennart@poettering.net>
Thu, 21 Nov 2013 18:32:33 +0000
(19:32 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 21 Nov 2013 20:12:36 +0000
(21:12 +0100)
src/hostname/hostnamed.c
patch
|
blob
|
history
diff --git
a/src/hostname/hostnamed.c
b/src/hostname/hostnamed.c
index 332c00bee5eb0c33d48dc09720416bc111f5ebf2..c874ea2f6cff3e95ff31c201d1ae63da76cc650e 100644
(file)
--- a/
src/hostname/hostnamed.c
+++ b/
src/hostname/hostnamed.c
@@
-266,7
+266,7
@@
static int context_write_data_other(Context *c) {
[PROP_CHASSIS] = "CHASSIS"
};
[PROP_CHASSIS] = "CHASSIS"
};
- char **l = NULL;
+
_cleanup_strv_free_
char **l = NULL;
int r, p;
assert(c);
int r, p;
assert(c);
@@
-285,17
+285,16
@@
static int context_write_data_other(Context *c) {
continue;
}
continue;
}
- if (asprintf(&t, "%s=%s", name[p], strempty(c->data[p])) < 0) {
- strv_free(l);
+ if (asprintf(&t, "%s=%s", name[p], strempty(c->data[p])) < 0)
return -ENOMEM;
return -ENOMEM;
- }
u = strv_env_set(l, t);
free(t);
u = strv_env_set(l, t);
free(t);
- strv_free(l);
if (!u)
return -ENOMEM;
if (!u)
return -ENOMEM;
+
+ strv_free(l);
l = u;
}
l = u;
}
@@
-307,10
+306,7
@@
static int context_write_data_other(Context *c) {
return 0;
}
return 0;
}
- r = write_env_file_label("/etc/machine-info", l);
- strv_free(l);
-
- return r;
+ return write_env_file_label("/etc/machine-info", l);
}
static int property_get_icon_name(
}
static int property_get_icon_name(