thanks for your responses, so this code is not safe:
* response = MHD_create_response_from_buffer(size,(void*)buffer, MHD_RESPMEM_PERSISTENT); ret = MHD_queue_response (connection, 200, response); MHD_destroy_response (response); free(buffer);* the following work-around seems to work fine: 1) define callback function to notify request completion (with MHD_OPTION_NOTIFY_COMPLETED) 2) do the free() in this callback function requestTerminationCallBack(char **buffer) { free(*buffer); } Regards Miguel