cipher: fix leak on initialization error
commitd4c64800bbe1332328695a551b84ae68590c90fd
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 9 Nov 2016 10:28:18 +0000 (9 14:28 +0400)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 21 Dec 2016 14:26:26 +0000 (21 14:26 +0000)
treecb1ceb45db7ac578f0f197b4fe164bd0cfb83205
parent82ecffa8c050bf5bbc13329e9b65eac1caa5b55c
cipher: fix leak on initialization error

On error path, ctx may be leaked. Assign ctx earlier, and call
qcrypto_cipher_free() on error.

Spotted thanks to ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
crypto/cipher-nettle.c