You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/libntru/files/05-libntru-0.2-fix-memory-l...

25 lines
770 B

From eada223e688d0777f852ca827a375121b375def3 Mon Sep 17 00:00:00 2001
From: gga01 <gga01@users.noreply.github.com>
Date: Wed, 16 Apr 2014 00:57:01 +0300
Subject: [PATCH] Fix memory leak (issue #7)
---
src/ntru.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ntru.c b/src/ntru.c
index b7513cb..73f0449 100644
--- a/src/ntru.c
+++ b/src/ntru.c
@@ -360,7 +360,7 @@ uint8_t ntru_encrypt_det(uint8_t *msg, uint16_t msg_len, NtruEncPubKey *pub, Ntr
rand_state = NULL;
NtruRandContext rand_ctx = {seed, seed_len, &rand_state};
uint8_t result = ntru_encrypt_internal(msg, msg_len, pub, params, rng, &rand_ctx, enc);
- if (rand_state == NULL)
+ if (rand_state != NULL)
free(rand_state);
return result;
}
--
1.9.1