From: Jouni Malinen Date: Wed, 27 Jun 2012 17:53:29 +0000 (+0300) Subject: WPS: Fix potential memory leak with NFC password token X-Git-Tag: hostap_2_0~591 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=582143e5440c59ca3c0f97e4e2fe73a0af8750ee;p=thirdparty%2Fhostap.git WPS: Fix potential memory leak with NFC password token The old stored public key hash needs to be freed before replacing the pointer with the new value. Signed-hostap: Jouni Malinen --- diff --git a/src/wps/wps_common.c b/src/wps/wps_common.c index 20e0824e2..510d99d3e 100644 --- a/src/wps/wps_common.c +++ b/src/wps/wps_common.c @@ -384,6 +384,7 @@ static int wps_parse_oob_dev_pwd(struct wps_context *wps, pos = attr.oob_dev_password; + wpabuf_free(oob_conf->pubkey_hash); oob_conf->pubkey_hash = wpabuf_alloc_copy(pos, WPS_OOB_PUBKEY_HASH_LEN); if (oob_conf->pubkey_hash == NULL) {