X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-seat-dbus.c;h=230f7f082a21619f17d437f08dc519ab352d2b8c;hp=5c535ba0ec41682fb743c7fb28eb8994983167de;hb=9444b1f20e311f073864d81e913bd4f32fe95cfd;hpb=77f40f165cc60a1d6b8a3503e4b7e46814d5935e diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c index 5c535ba0e..230f7f082 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -209,8 +209,8 @@ static int bus_seat_append_idle_hint_since(DBusMessageIter *i, const char *prope } static int get_seat_for_path(Manager *m, const char *path, Seat **_s) { + _cleanup_free_ char *id = NULL; Seat *s; - char *id; assert(m); assert(path); @@ -224,8 +224,6 @@ static int get_seat_for_path(Manager *m, const char *path, Seat **_s) { return -ENOMEM; s = hashmap_get(m->seats, id); - free(id); - if (!s) return -ENOENT; @@ -348,7 +346,7 @@ const DBusObjectPathVTable bus_seat_vtable = { }; char *seat_bus_path(Seat *s) { - _cleanup_free_ char *t; + _cleanup_free_ char *t = NULL; assert(s);