commit 93a1a1cdae66ab06c0fa3f23332f6faada936e27
parent 3b2ba8d5037b6c75065deb8cccaa0a9165731319
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sat, 18 Jul 2026 12:12:02 +0200
fix leak, clean up logic
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/challenger/challenger-httpd_challenge.c b/src/challenger/challenger-httpd_challenge.c
@@ -25,6 +25,7 @@
#include <gnunet/gnunet_pq_lib.h>
#include "challenger-httpd_challenge.h"
#include <taler/taler_json_lib.h>
+#include <taler/taler_mhd_lib.h>
#include <taler/taler_templating_lib.h>
#include <taler/taler_signatures.h>
#include "challenger-database/challenge_set_address_and_pin.h"
@@ -898,26 +899,21 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
{
enum GNUNET_GenericReturnValue ret;
char *url;
- struct MHD_Response *response;
- json_t *args;
ret = CH_build_full_redirect_url (&bc->nonce,
hc->connection,
&url);
if (GNUNET_OK != ret)
return (GNUNET_NO == ret) ? MHD_YES : MHD_NO;
- args = GNUNET_JSON_PACK (
+ ret = TALER_MHD_REPLY_JSON_PACK (
+ hc->connection,
+ MHD_HTTP_OK,
GNUNET_JSON_pack_string ("type",
"completed"),
GNUNET_JSON_pack_string ("redirect_url",
url)
);
GNUNET_free (url);
- response = TALER_MHD_make_json (args);
- ret = MHD_queue_response (hc->connection,
- MHD_HTTP_OK,
- response);
- MHD_destroy_response (response);
return ret;
}
if (bc->address_refused)