logind-core: modernize button_free()

This commit is contained in:
David Tardon
2023-04-27 21:42:38 +02:00
parent 93eceb59e6
commit 737e0f12d9
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -53,8 +53,9 @@ Button* button_new(Manager *m, const char *name) {
return b;
}
void button_free(Button *b) {
assert(b);
Button *button_free(Button *b) {
if (!b)
return NULL;
hashmap_remove(b->manager->buttons, b->name);
@@ -65,7 +66,8 @@ void button_free(Button *b) {
free(b->name);
free(b->seat);
free(b);
return mfree(b);
}
int button_set_seat(Button *b, const char *sn) {
+1 -1
View File
@@ -20,7 +20,7 @@ struct Button {
};
Button* button_new(Manager *m, const char *name);
void button_free(Button *b);
Button *button_free(Button *b);
int button_open(Button *b);
int button_set_seat(Button *b, const char *sn);
int button_check_switches(Button *b);