Fix memory leak on NFC DH generation error path
It was possible for some NFC DH generation error paths to leak memory since the old private/public key was not freed if an allocation failed. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
c5ef7bbfa5
commit
4104267e81
2 changed files with 7 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
|
||||
{
|
||||
wpabuf_free(*publ);
|
||||
*publ = dh_init(dh_groups_get(5), priv);
|
||||
if (*publ == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue