1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

logind: use free_and_strdup() where appropriate

This commit is contained in:
Lennart Poettering 2020-12-09 10:07:37 +01:00
parent c74d5fe25d
commit f2835dd4a6

View File

@ -68,19 +68,9 @@ void button_free(Button *b) {
}
int button_set_seat(Button *b, const char *sn) {
char *s;
assert(b);
assert(sn);
s = strdup(sn);
if (!s)
return -ENOMEM;
free(b->seat);
b->seat = s;
return 0;
return free_and_strdup(&b->seat, sn);
}
static void button_lid_switch_handle_action(Manager *manager, bool is_edge) {