If the loop is exited normally, i.e. we did not find anything proper
within DH_NUM_TRIES, we try to BN_free a second time.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 14 19:17:06 CET 2013 on sn-devel-104
return 0;
}
}
- if (dh->pub_key)
+ if (dh->pub_key) {
BN_free(dh->pub_key);
+ dh->pub_key = NULL;
+ }
mp_init_multi(&pub, &priv_key, &g, &p, NULL);