Skip to content

Commit

Permalink
Dereference the prices used in function convert_price
Browse files Browse the repository at this point in the history
The two prices used in convert_price had there reference count
increased in extract_common_prices. This lead to the reference count
continuously increasing and not being freed on close so add
gnc_price_unref on both prices to reduce the reference count.
  • Loading branch information
Bob-IT committed Aug 15, 2021
1 parent 77cf90f commit cacdb12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libgnucash/engine/gnc-pricedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,9 @@ convert_price (const gnc_commodity *from, const gnc_commodity *to, PriceTuple tu

price = gnc_numeric_div (to_val, from_val, GNC_DENOM_AUTO, no_round);

gnc_price_unref (tuple.from);
gnc_price_unref (tuple.to);

if (from_cur == from && to_cur == to)
return price;

Expand Down

0 comments on commit cacdb12

Please sign in to comment.