]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix potential memory leak with NFC password token
authorJouni Malinen <j@w1.fi>
Wed, 27 Jun 2012 17:53:29 +0000 (20:53 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 27 Jun 2012 18:22:12 +0000 (21:22 +0300)
The old stored public key hash needs to be freed before replacing
the pointer with the new value.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/wps/wps_common.c

index 20e0824e2f4a51688855f21254c67c16b0884835..510d99d3efbc72fd2d98647720b0d355a3525ed2 100644 (file)
@@ -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) {