mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix memory leaks logging with gnc_numeric_to_string()
The value returned by gnc_numeric_to_string() needs to be freed. Use gnc_num_dbg_to_string() instead.
This commit is contained in:
@@ -1271,8 +1271,15 @@ xaccSplitSetValue (Split *s, gnc_numeric amt)
|
||||
GNC_HOW_RND_ROUND_HALF_UP);
|
||||
if (gnc_numeric_check(new_val) == GNC_ERROR_OK &&
|
||||
!(gnc_numeric_zero_p (new_val) && !gnc_numeric_zero_p (amt)))
|
||||
{
|
||||
s->value = new_val;
|
||||
else PERR("numeric error %s in converting the split value's denominator with amount %s and denom %d", gnc_numeric_errorCode_to_string(gnc_numeric_check(new_val)), gnc_numeric_to_string(amt), get_currency_denom(s));
|
||||
}
|
||||
else
|
||||
{
|
||||
PERR("numeric error %s in converting the split value's denominator with amount %s and denom %d",
|
||||
gnc_numeric_errorCode_to_string(gnc_numeric_check(new_val)),
|
||||
gnc_num_dbg_to_string (amt), get_currency_denom(s));
|
||||
}
|
||||
|
||||
SET_GAINS_VDIRTY(s);
|
||||
mark_split (s);
|
||||
|
||||
Reference in New Issue
Block a user