Re: [libmicrohttpd] Freeing data added to MHD_create_response_from_buffer

2022-01-17 Thread Gavin Henry
Awesome. All leaks are now gone! Thank you Nicolas.

Re: [libmicrohttpd] Freeing data added to MHD_create_response_from_buffer

2022-01-17 Thread Gavin Henry
mode at: https://www.gnu.org/software/libmicrohttpd/

Re: [libmicrohttpd] Freeing data added to MHD_create_response_from_buffer

2022-01-17 Thread Gavin Henry
> > If I understand your code, you use MHD_create_response_from_buffer > with the MHD_RESPMEM_PERSISTENT mode, which, according to the > documentation [1], means that 'reply' should be static/global, which isn't. > > You can either: > - use MHD_RESPMEM_MUST_FREE and let MHD free 'reply' after use

Re: [libmicrohttpd] Freeing data added to MHD_create_response_from_buffer

2022-01-17 Thread Nicolas Mora
Hello Gavin, [resend to the list, sorry fot the noise Gavin] Le 2022-01-17 à 14 h 40, Gavin Henry a écrit :> 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_resp

[libmicrohttpd] Freeing data added to MHD_create_response_from_buffer

2022-01-17 Thread Gavin Henry
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.c