uterm_monitor: initialize list heads correctly
List heads must be initialized and cannot be set to NULL by default. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
1 parent
c67b20d89e
commit
c81a83fb3a
1 file changed
+2
@@ -175,6 +175,7 @@ static void monitor_new_seat(struct uterm_monitor *mon, const char *name)
|
||||
return;
|
||||
memset(seat, 0, sizeof(*seat));
|
||||
seat->mon = mon;
|
||||
kmscon_dlist_init(&seat->devices);
|
||||
|
||||
seat->name = strdup(name);
|
||||
if (!seat->name)
|
||||
@@ -498,6 +499,7 @@ int uterm_monitor_new(struct uterm_monitor **out,
|
||||
mon->eloop = eloop;
|
||||
mon->cb = cb;
|
||||
mon->data = data;
|
||||
kmscon_dlist_init(&mon->seats);
|
||||
|
||||
ret = sd_login_monitor_new("seat", &mon->sd_mon);
|
||||
if (ret) {
|
||||
|
||||
Reference in new issue
Block a user