summaryrefslogtreecommitdiff
path: root/src/auditor/taler-wire-auditor.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-18 18:14:33 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-18 18:14:33 +0100
commitee6b2d5286df473cf51575b025117f273cfa14be (patch)
treea9105a3ab21dd20b19ab15eed0f77a8cca21b03c /src/auditor/taler-wire-auditor.c
parentb3ff66d05775e94fef9a36eab4ebc67186f825dd (diff)
downloadexchange-ee6b2d5286df473cf51575b025117f273cfa14be.tar.gz
exchange-ee6b2d5286df473cf51575b025117f273cfa14be.tar.bz2
exchange-ee6b2d5286df473cf51575b025117f273cfa14be.zip
fix leak
Diffstat (limited to 'src/auditor/taler-wire-auditor.c')
-rw-r--r--src/auditor/taler-wire-auditor.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/auditor/taler-wire-auditor.c b/src/auditor/taler-wire-auditor.c
index 9801a95d4..2d0138506 100644
--- a/src/auditor/taler-wire-auditor.c
+++ b/src/auditor/taler-wire-auditor.c
@@ -1362,6 +1362,7 @@ history_debit_cb (void *cls,
{
struct WireAccount *wa = cls;
struct ReserveOutInfo *roi;
+ size_t slen;
(void) json;
if (NULL == details)
@@ -1389,14 +1390,19 @@ history_debit_cb (void *cls,
TALER_B2S (&details->wtid));
/* Update offset */
wa->out_wire_off = row_off;
- roi = GNUNET_new (struct ReserveOutInfo);
+ slen = strlen (details->credit_account_url) + 1;
+ roi = GNUNET_malloc (sizeof (struct ReserveOutInfo)
+ + slen);
GNUNET_CRYPTO_hash (&details->wtid,
sizeof (details->wtid),
&roi->subject_hash);
roi->details.amount = details->amount;
roi->details.execution_date = details->execution_date;
roi->details.wtid = details->wtid;
- roi->details.credit_account_url = GNUNET_strdup (details->credit_account_url);
+ roi->details.credit_account_url = (const char *) &roi[1];
+ memcpy (&roi[1],
+ details->credit_account_url,
+ slen);
if (GNUNET_OK !=
GNUNET_CONTAINER_multihashmap_put (out_map,
&roi->subject_hash,