From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Max Reitz" <mreitz@redhat.com>,
qemu-block@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>
Subject: [Qemu-devel] [PULL 2/6] crypto/block-luks: fix memory leak in qcrypto_block_luks_create
Date: Wed, 12 Dec 2018 11:24:46 +0000 [thread overview]
Message-ID: <20181212112450.2103-3-berrange@redhat.com> (raw)
In-Reply-To: <20181212112450.2103-1-berrange@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Free block->cipher and block->ivgen on error path.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
crypto/block-luks.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 5738124773..51e24d23ca 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -1341,6 +1341,9 @@ qcrypto_block_luks_create(QCryptoBlock *block,
qcrypto_ivgen_free(ivgen);
qcrypto_cipher_free(cipher);
+ qcrypto_cipher_free(block->cipher);
+ qcrypto_ivgen_free(block->ivgen);
+
g_free(luks);
return -1;
}
--
2.19.2
next prev parent reply other threads:[~2018-12-12 11:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 11:24 [Qemu-devel] [PULL 0/6] Qcrypto next patches Daniel P. Berrangé
2018-12-12 11:24 ` [Qemu-devel] [PULL 1/6] crypto: Fix defaults in QCryptoBlockCreateOptionsLUKS Daniel P. Berrangé
2018-12-12 11:24 ` Daniel P. Berrangé [this message]
2018-12-12 11:24 ` [Qemu-devel] [PULL 3/6] crypto/block: refactor qcrypto_block_*crypt_helper functions Daniel P. Berrangé
2018-12-12 11:24 ` [Qemu-devel] [PULL 4/6] crypto/block: rename qcrypto_block_*crypt_helper Daniel P. Berrangé
2018-12-12 11:24 ` [Qemu-devel] [PULL 5/6] crypto/block: introduce qcrypto_block_*crypt_helper functions Daniel P. Berrangé
2018-12-12 11:24 ` [Qemu-devel] [PULL 6/6] crypto: support multiple threads accessing one QCryptoBlock Daniel P. Berrangé
2018-12-14 9:50 ` [Qemu-devel] [PULL 0/6] Qcrypto next patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181212112450.2103-3-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.