Browse Source

EAP-PWD peer: Fix possible memory leak on error path

Fix possible memory leak in eap_pwd_perform_commit_exchange().

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Ilan Peer 9 years ago
parent
commit
b8f02d8baf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/eap_peer/eap_pwd.c

+ 1 - 1
src/eap_peer/eap_pwd.c

@@ -418,7 +418,6 @@ eap_pwd_perform_commit_exchange(struct eap_sm *sm, struct eap_pwd_data *data,
 		wpa_printf(MSG_INFO, "EAP-PWD (peer): element inversion fail");
 		wpa_printf(MSG_INFO, "EAP-PWD (peer): element inversion fail");
 		goto fin;
 		goto fin;
 	}
 	}
-	BN_clear_free(mask);
 
 
 	if (((x = BN_new()) == NULL) ||
 	if (((x = BN_new()) == NULL) ||
 	    ((y = BN_new()) == NULL)) {
 	    ((y = BN_new()) == NULL)) {
@@ -555,6 +554,7 @@ fin:
 	os_free(element);
 	os_free(element);
 	BN_clear_free(x);
 	BN_clear_free(x);
 	BN_clear_free(y);
 	BN_clear_free(y);
+	BN_clear_free(mask);
 	BN_clear_free(cofactor);
 	BN_clear_free(cofactor);
 	EC_POINT_clear_free(K);
 	EC_POINT_clear_free(K);
 	EC_POINT_clear_free(point);
 	EC_POINT_clear_free(point);