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=ffb9162e56c435f7a7add489d410b9e96c94a555;hb=f3f6ae7c983865ea37e8ddfbd676586e55280f1e;hpb=da2587d5154e11d4e643e326793f3ce2cc48dee6 diff --git a/src/login/logind-device.c b/src/login/logind-device.c index ffb9162e5..6537fa04b 100644 --- a/src/login/logind-device.c +++ b/src/login/logind-device.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -36,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;