Re: [Qemu-devel] [PATCHv2] cipher: fix leak on initialization error

2016-11-09 Thread Daniel P. Berrange
On Wed, Nov 09, 2016 at 02:28:18PM +0400, Marc-André Lureau wrote: > 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 > --- > crypto/cipher-nettle.c | 5 ++--- > 1 file changed, 2 in

[Qemu-devel] [PATCHv2] cipher: fix leak on initialization error

2016-11-09 Thread Marc-André Lureau
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 --- crypto/cipher-nettle.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto/cipher-nettle.c b/crypto/cipher-nett