logind: use free_and_replace() where that makes sense

This commit is contained in:
Lennart Poettering
2019-07-23 16:08:06 +02:00
parent 11b0dd0e30
commit 09f300c4d0
+2 -4
View File
@@ -245,8 +245,7 @@ int inhibitor_load(Inhibitor *i) {
if (r < 0)
return log_oom();
free(i->who);
i->who = cc;
free_and_replace(i->who, cc);
}
if (why) {
@@ -254,8 +253,7 @@ int inhibitor_load(Inhibitor *i) {
if (r < 0)
return log_oom();
free(i->why);
i->why = cc;
free_and_replace(i->why, cc);
}
if (i->fifo_path) {