[gnc-amount-edit] g_free char* empty string.

1 byte is allocated if filtered_string is the empty string. free it.
This commit is contained in:
Christopher Lam 2021-08-15 17:03:08 +08:00
parent 57866eed88
commit c442192bb4

View File

@ -386,6 +386,7 @@ gnc_amount_edit_expr_is_valid (GNCAmountEdit *gae, gnc_numeric *amount,
if (!filtered_string || *filtered_string == '\0') if (!filtered_string || *filtered_string == '\0')
{ {
*amount = gnc_numeric_zero (); *amount = gnc_numeric_zero ();
g_free (filtered_string);
if (empty_ok) if (empty_ok)
return -1; /* indicate an empty field */ return -1; /* indicate an empty field */
else else