[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] Freeing data added to MHD_create_response_from_buffer
From: |
Gavin Henry |
Subject: |
[libmicrohttpd] Freeing data added to MHD_create_response_from_buffer |
Date: |
Mon, 17 Jan 2022 19:40:53 +0000 |
Hi all,
I'm using json_dumps from jansson in my MHD_create_response_from_buffer
Where is the best place to free this? I've tried at the end of my responses:
MHD_destroy_response(response);
free(json_reply)
return ret;
but this obviously breaks the data that goes to the client:
https://github.com/SentryPeer/SentryPeer/blob/main/src/http_ip_address_route.c#L45
this is my messy route_handler at the moment:
https://github.com/SentryPeer/SentryPeer/blob/8eb8db5b71be9c3e6b987850569992121846ef41/src/http_routes.c#L44
Thanks.
--
Kind Regards,
Gavin Henry.
https://sentrypeer.org
- [libmicrohttpd] Freeing data added to MHD_create_response_from_buffer,
Gavin Henry <=