X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-device.c;h=6537fa04bfcbd6685fa5132d28ca508aea81b591;hp=eb5edd1cd5e11d2ce8ef2731668a1e65701497ad;hb=f3f6ae7c983865ea37e8ddfbd676586e55280f1e;hpb=07045a1a92c839fd2af80bd0c060a595021bc3b3 diff --git a/src/login/logind-device.c b/src/login/logind-device.c index eb5edd1cd..6537fa04b 100644 --- a/src/login/logind-device.c +++ b/src/login/logind-device.c @@ -34,15 +34,12 @@ Device* device_new(Manager *m, const char *sysfs, bool master) { return NULL; d->sysfs = strdup(sysfs); - if (!d->sysfs) { - free(d); - return NULL; - } + if (!d->sysfs) + return mfree(d); if (hashmap_put(m->devices, d->sysfs, d) < 0) { free(d->sysfs); - free(d); - return NULL; + return mfree(d); } d->manager = m;