Skip to content
Snippets Groups Projects
Commit 8cee8402 authored by Adam Knapp's avatar Adam Knapp
Browse files

BigInt memory leak fix (issue #651)


Signed-off-by: default avatarAdam Knapp <adam.knapp@ericsson.com>
parent aa237e65
No related branches found
No related tags found
1 merge request!275BigInt memory leak fix (issue #651)
......@@ -290,6 +290,7 @@ int_val_t int_val_t::operator-(const int_val_t& right) const
char *result_str = BN_bn2dec(result);
Int result_ll = string2Int(result_str, Location());
OPENSSL_free(result_str);
BN_free(result);
return int_val_t(result_ll);
} else {
return int_val_t(result);
......@@ -378,6 +379,7 @@ int_val_t int_val_t::operator/(const int_val_t& right) const
char *result_str = BN_bn2dec(result);
Int result_ll = string2Int(result_str, Location());
OPENSSL_free(result_str);
BN_free(result);
return int_val_t(result_ll);
} else {
if (right.is_native())
......
......@@ -1724,6 +1724,7 @@ int INTEGER::get_nof_digits()
++digits;
BN_div_word(x, 10);
}
BN_free(x);
}
return digits;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment