From f4e2c13c68b57f670458b7ed1c6144ad860d88fa Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Sep 2025 11:04:48 +0200 Subject: [PATCH] fix example FTBFS --- doc/examples/simplepost.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c index f8607e8d..704a75ea 100644 --- a/doc/examples/simplepost.c +++ b/doc/examples/simplepost.c @@ -141,15 +141,15 @@ answer_to_connection (void *cls, size_t *upload_data_size, void **req_cls) { + struct connection_info_struct *con_info = *req_cls; + (void) cls; /* Unused. Silent compiler warning. */ (void) url; /* Unused. Silent compiler warning. */ (void) version; /* Unused. Silent compiler warning. */ - - if (NULL == *req_cls) + if (NULL == con_info) { - struct connection_info_struct *con_info; - con_info = malloc (sizeof (struct connection_info_struct)); + *req_cls = (void *) con_info; if (NULL == con_info) return MHD_NO; con_info->answerstring = NULL; @@ -172,8 +172,6 @@ answer_to_connection (void *cls, { con_info->connectiontype = GET; } - *req_cls = (void *) con_info; - return MHD_YES; } if (GET == con_info->connectiontype)