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:
Vladimir Sementsov-Ogievskiy 2018-12-07 19:13:47 +03:00 committed by Daniel P. Berrangé
parent a8b826d47a
commit b640adca9f
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}