1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00

main: make sure set_machine_id() doesn't clobber arg_machine_id on failure

This commit is contained in:
Lennart Poettering 2016-07-21 20:22:42 +02:00
parent 15b1248a6b
commit e042eab720

View File

@ -291,14 +291,16 @@ static int parse_crash_chvt(const char *value) {
}
static int set_machine_id(const char *m) {
sd_id128_t t;
assert(m);
if (sd_id128_from_string(m, &arg_machine_id) < 0)
if (sd_id128_from_string(m, &t) < 0)
return -EINVAL;
if (sd_id128_is_null(arg_machine_id))
if (sd_id128_is_null(t))
return -EINVAL;
arg_machine_id = t;
return 0;
}