mirror of https://gitee.com/openkylin/qemu.git
crypto/block-luks: fix memory leak in qcrypto_block_luks_create
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>
This commit is contained in:
parent
a8b826d47a
commit
b640adca9f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue