[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: fix leak
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: fix leak |
Date: |
Sat, 18 Jan 2020 18:14:36 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new ee6b2d52 fix leak
ee6b2d52 is described below
commit ee6b2d5286df473cf51575b025117f273cfa14be
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Jan 18 18:14:33 2020 +0100
fix leak
---
src/auditor/taler-auditor.c | 13 +++++++------
src/auditor/taler-wire-auditor.c | 10 ++++++++--
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 0a947727..cc526ec8 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -2835,6 +2835,7 @@ check_wire_out_cb
&wcc.h_wire))
{
GNUNET_break (0);
+ GNUNET_free (method);
return GNUNET_SYSERR;
}
qs = edb->lookup_wire_transfer (edb->cls,
@@ -2881,16 +2882,16 @@ check_wire_out_cb
&wcc.total_deposits,
wire_fee))
{
- report_amount_arithmetic_inconsistency
- ("wire out (fee structure)",
- rowid,
- &wcc.total_deposits,
- wire_fee,
- -1);
+ report_amount_arithmetic_inconsistency ("wire out (fee structure)",
+ rowid,
+ &wcc.total_deposits,
+ wire_fee,
+ -1);
/* If fee arithmetic fails, we just assume the fee is zero */
final_amount = wcc.total_deposits;
}
}
+ GNUNET_free (method);
/* Round down to amount supported by wire method */
GNUNET_break (TALER_amount_round_down (&final_amount,
diff --git a/src/auditor/taler-wire-auditor.c b/src/auditor/taler-wire-auditor.c
index 9801a95d..2d013850 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,
--
To stop receiving notification emails like this one, please contact
address@hidden.