1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 17:25:34 +03:00

login: fix use after free

id is basename(state_file)
This commit is contained in:
Yu Watanabe 2019-09-03 01:55:46 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent c1087fdd0d
commit 0917293072

View File

@ -72,13 +72,13 @@ Inhibitor* inhibitor_free(Inhibitor *i) {
sd_event_source_unref(i->event_source);
safe_close(i->fifo_fd);
hashmap_remove(i->manager->inhibitors, i->id);
/* Note that we don't remove neither the state file nor the fifo path here, since we want both to
* survive daemon restarts */
free(i->state_file);
free(i->fifo_path);
hashmap_remove(i->manager->inhibitors, i->id);
return mfree(i);
}