don't leak in the error case

Applying patch from @FauxFaux

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
This commit is contained in:
Eneas U de Queiroz 2018-05-25 16:07:53 -03:00
parent 166633395d
commit 4e3c2e134e

View File

@ -99,13 +99,12 @@ DHFromArray(char *dh_p, size_t dh_p_size, char *dh_g, size_t dh_g_size) {
p = BN_bin2bn(dh_p, dh_p_size, NULL);
if (p == NULL) {
BN_free(p);
return (NULL);
}
g = BN_bin2bn(dh_g, dh_g_size, NULL);
if (g == NULL) {
BN_free(g);
BN_free(p);
return (NULL);
}