diff signkey.c @ 1058:063c38ea622b

Fix some memory leaks in ecc code
author Matt Johnston <matt@ucc.asn.au>
date Sun, 01 Mar 2015 22:44:36 +0800
parents 0da8ba489c23
children c45d65392c1a
line wrap: on
line diff
--- a/signkey.c	Sat Feb 28 23:49:39 2015 +0800
+++ b/signkey.c	Sun Mar 01 22:44:36 2015 +0800
@@ -187,6 +187,7 @@
 		if (eck) {
 			if (*eck) {
 				ecc_free(*eck);
+				m_free(*eck);
 				*eck = NULL;
 			}
 			*eck = buf_get_ecdsa_pub_key(buf);
@@ -255,6 +256,7 @@
 		if (eck) {
 			if (*eck) {
 				ecc_free(*eck);
+				m_free(*eck);
 				*eck = NULL;
 			}
 			*eck = buf_get_ecdsa_priv_key(buf);
@@ -355,18 +357,21 @@
 #ifdef DROPBEAR_ECC_256
 	if (key->ecckey256) {
 		ecc_free(key->ecckey256);
+		m_free(key->ecckey256);
 		key->ecckey256 = NULL;
 	}
 #endif
 #ifdef DROPBEAR_ECC_384
 	if (key->ecckey384) {
 		ecc_free(key->ecckey384);
+		m_free(key->ecckey384);
 		key->ecckey384 = NULL;
 	}
 #endif
 #ifdef DROPBEAR_ECC_521
 	if (key->ecckey521) {
 		ecc_free(key->ecckey521);
+		m_free(key->ecckey521);
 		key->ecckey521 = NULL;
 	}
 #endif