aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-17 00:22:28 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-17 00:22:28 +0100
commitec3a4aad2322ad1158372cf293d202c6890ce124 (patch)
treed435e2b57241bfae0b7a28f029ae895d45650771 /src
parent70e7bc1184ca3717dc5cbe1ce0b18ea6a6500108 (diff)
fix memory leak of rhistory, always allocate it on the heap
Diffstat (limited to 'src')
-rw-r--r--src/lib/exchange_api_reserve.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/exchange_api_reserve.c b/src/lib/exchange_api_reserve.c
index d4d0cb9a1..9c0ff6d7a 100644
--- 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,