From: Srikanth Marepalli Date: Thu, 20 Sep 2018 09:16:54 +0000 (+0530) Subject: Free dh_ctx on failure in wps_nfc_gen_dh() X-Git-Tag: hostap_2_7~173 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e66226016204631da0c5622e96ce1e5c73a28d38;p=thirdparty%2Fhostap.git Free dh_ctx on failure in wps_nfc_gen_dh() This is needed to avoid a memory leak on an error path. Signed-off-by: Jouni Malinen --- diff --git a/src/wps/wps_common.c b/src/wps/wps_common.c index 2e3472177..bcae1ba58 100644 --- a/src/wps/wps_common.c +++ b/src/wps/wps_common.c @@ -654,6 +654,7 @@ int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey) pub = wpabuf_zeropad(pub, 192); if (pub == NULL) { wpabuf_free(priv); + dh5_free(dh_ctx); return -1; } wpa_hexdump_buf(MSG_DEBUG, "WPS: Generated new DH pubkey", pub);