summaryrefslogtreecommitdiff
path: root/src/cryptsetup
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptsetup')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 8ac5ab730a..de0a3b6f9c 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -264,16 +264,13 @@ static crypto_device *get_crypto_device(const char *uuid) {
d->keyfile = d->options = d->name = NULL;
d->uuid = strdup(uuid);
- if (!d->uuid) {
- free(d);
- return NULL;
- }
+ if (!d->uuid)
+ return mfree(d);
r = hashmap_put(arg_disks, d->uuid, d);
if (r < 0) {
free(d->uuid);
- free(d);
- return NULL;
+ return mfree(d);
}
}