commit 7041226ef17c846080b0dd95dc825602c0b4928b
parent 7f2e349a37bef5b42e8743c3a3a06acdd3175a3a
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sun, 16 Aug 2026 23:27:49 +0200
do not free aliased string
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c
@@ -416,8 +416,17 @@ reserve_close_transaction (
rcc->timestamp,
&rcc->balance,
&wf->closing);
+ if (rcc->payto_uri.full_payto == payto_uri.full_payto)
+ {
+ /* We fell back to the reserve's origin account above, so @e rcc
+ merely aliases the string we are about to free. If instead the
+ client supplied the target account, @e rcc->payto_uri points into
+ the request JSON and must survive: this function is a retryable
+ transaction callback, and clearing it would make the retry fall
+ back to the origin account (or fail with a 409). */
+ rcc->payto_uri.full_payto = NULL;
+ }
GNUNET_free (payto_uri.full_payto);
- rcc->payto_uri.full_payto = NULL;
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
GNUNET_break (0);