commit daa3bcf2393060d619cbb694f189d099db30f509
parent 51b71919d7584042a6063702ce30b569dfd0ce73
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 6 Jul 2026 00:03:36 +0200
handle allocation failure more nicely
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/backend/taler-merchant-report-generator.c b/src/backend/taler-merchant-report-generator.c
@@ -615,7 +615,21 @@ fetch_and_transmit (
ra->post_ctx.headers,
&curl_completed_cb,
ra);
+ /* On both success and failure ownership of the easy handle has been
+ taken over by GNUNET_CURL_job_add_raw() (on failure it already calls
+ curl_easy_cleanup()), so we must drop our reference to avoid a
+ double-free in free_ra(). */
ra->eh = NULL;
+ if (NULL == ra->job)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to start the curl job for report #%llu\n",
+ (unsigned long long) ra->report_id);
+ finish_transmission (ra,
+ TALER_EC_GENERIC_CURL_ALLOCATION_FAILURE,
+ "GNUNET_CURL_job_add_raw");
+ return;
+ }
}