exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit ec3a4aad2322ad1158372cf293d202c6890ce124
parent 70e7bc1184ca3717dc5cbe1ce0b18ea6a6500108
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 17 Feb 2019 00:22:28 +0100

fix memory leak of rhistory, always allocate it on the heap

Diffstat:
Msrc/lib/exchange_api_reserve.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/exchange_api_reserve.c b/src/lib/exchange_api_reserve.c @@ -447,6 +447,7 @@ free_rhistory (struct TALER_EXCHANGE_ReserveHistory *rhistory, break; } } + GNUNET_free (rhistory); } @@ -503,9 +504,10 @@ handle_reserve_status_finished (void *cls, } len = json_array_size (history); { - struct TALER_EXCHANGE_ReserveHistory rhistory[len]; + struct TALER_EXCHANGE_ReserveHistory *rhistory; - memset (rhistory, 0, sizeof (rhistory)); + rhistory = GNUNET_new_array (len, + struct TALER_EXCHANGE_ReserveHistory); if (GNUNET_OK != parse_reserve_history (rsh->exchange, history,