From: Lennart Poettering Date: Mon, 5 Jan 2015 23:31:38 +0000 (+0100) Subject: machined: simplification X-Git-Tag: v219~677 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=17a20d64912e95ea90380381f85e9ef7fd56ff67;hp=13790add4bf648fed816361794d8277a75253410 machined: simplification --- diff --git a/src/machine/machine.c b/src/machine/machine.c index b28311879..6c01617cf 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -202,6 +202,9 @@ int machine_save(Machine *m) { goto finish; } + free(temp_path); + temp_path = NULL; + if (m->unit) { char *sl; @@ -213,12 +216,11 @@ int machine_save(Machine *m) { } finish: - if (r < 0) { - if (temp_path) - unlink(temp_path); + if (temp_path) + unlink(temp_path); + if (r < 0) log_error_errno(r, "Failed to save machine data %s: %m", m->state_file); - } return r; }