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

This commit is contained in:
Christian Grothoff 2019-02-17 00:22:28 +01:00
parent 70e7bc1184
commit ec3a4aad23
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -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,