diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-18 20:50:25 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-18 20:50:25 +0100 |
commit | 6fc2a5f9493e614a458cfc57ad42c782d06ba07a (patch) | |
tree | 14dcd68aa3bbf9f226d7b1e121c04d2019cd8675 /src/mhd/mhd_responses.c | |
parent | c1996b7e69d7cb51adbd687b3a1cffdc02e28d3c (diff) |
fixes
Diffstat (limited to 'src/mhd/mhd_responses.c')
-rw-r--r-- | src/mhd/mhd_responses.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mhd/mhd_responses.c b/src/mhd/mhd_responses.c index aeb3b0b69..6e5181482 100644 --- a/src/mhd/mhd_responses.c +++ b/src/mhd/mhd_responses.c @@ -278,20 +278,26 @@ int TALER_MHD_reply_cors_preflight (struct MHD_Connection *connection) { struct MHD_Response *resp; + int ret; - GNUNET_assert (NULL != (resp = MHD_create_response_from_buffer (0, NULL, - MHD_RESPMEM_PERSISTENT))); + resp = MHD_create_response_from_buffer (0, + NULL, + MHD_RESPMEM_PERSISTENT); + if (NULL == resp) + return MHD_NO; /* This adds the Access-Control-Allow-Origin header. * All endpoints of the exchange allow CORS. */ TALER_MHD_add_global_headers (resp); GNUNET_break (MHD_YES == MHD_add_response_header (resp, - // Not available as MHD constant yet + /* Not available as MHD constant yet */ "Access-Control-Allow-Headers", "*")); - GNUNET_assert (MHD_YES == MHD_queue_response (connection, MHD_HTTP_NO_CONTENT, - resp)); - return MHD_YES; + ret = MHD_queue_response (connection, + MHD_HTTP_NO_CONTENT, + resp); + MHD_destroy_response (resp); + return ret; } |