summaryrefslogtreecommitdiff
path: root/src/login/logind-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind-device.c')
-rw-r--r--src/login/logind-device.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/login/logind-device.c b/src/login/logind-device.c
index eb5edd1cd5..6537fa04bf 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;