From abcd3511bf5f0c820e212abdd9b50ef0df88cb85 Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Thu, 26 Apr 2018 16:39:39 +0200 Subject: [PATCH] Fix memory leak in luksKillSlot action. --- src/cryptsetup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 8d2bf337..e28bdcf0 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -1212,7 +1212,8 @@ static int action_luksKillSlot(void) log_err(_("Keyslot %d is not active."), opt_key_slot); /* fall through */ case CRYPT_SLOT_INVALID: - return -EINVAL; + r = -EINVAL; + goto out; } if (!opt_batch_mode || opt_key_file || !isatty(STDIN_FILENO)) {