From: Daniel Borkmann Date: Sat, 15 Jun 2013 18:15:40 +0000 (+0200) Subject: curve: free buffers in reverse order to allocation X-Git-Tag: v0.5.8-rc1~121 X-Git-Url: https://repo.or.cz/w/netsniff-ng.git/commitdiff_plain/d9b5259582a6073d1c2bada8c3294c7550c7b678 curve: free buffers in reverse order to allocation First destroy spinlocks, then free the encryption and decryption buffers. Signed-off-by: Daniel Borkmann --- diff --git a/curve.c b/curve.c index 56ecf47e..319991b6 100644 --- a/curve.c +++ b/curve.c @@ -42,11 +42,11 @@ static void curve25519_init(struct curve25519_struct *curve) static void curve25519_destroy(struct curve25519_struct *curve) { - xzfree(curve->enc, curve->enc_size); - xzfree(curve->dec, curve->dec_size); - spinlock_destroy(&curve->enc_lock); spinlock_destroy(&curve->dec_lock); + + xzfree(curve->enc, curve->enc_size); + xzfree(curve->dec, curve->dec_size); } struct curve25519_struct *curve25519_tfm_alloc(void)