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 <jouni@codeaurora.org>
This commit is contained in:
parent
50b77f50e8
commit
e662260162
1 changed files with 1 additions and 0 deletions
|
@ -654,6 +654,7 @@ int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey)
|
||||||
pub = wpabuf_zeropad(pub, 192);
|
pub = wpabuf_zeropad(pub, 192);
|
||||||
if (pub == NULL) {
|
if (pub == NULL) {
|
||||||
wpabuf_free(priv);
|
wpabuf_free(priv);
|
||||||
|
dh5_free(dh_ctx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
wpa_hexdump_buf(MSG_DEBUG, "WPS: Generated new DH pubkey", pub);
|
wpa_hexdump_buf(MSG_DEBUG, "WPS: Generated new DH pubkey", pub);
|
||||||
|
|
Loading…
Reference in a new issue