commit f4e2c13c68b57f670458b7ed1c6144ad860d88fa
parent ff13abc1c1d7d2b30d69d5c0bd4a237e1801c50b
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 16 Sep 2025 11:04:48 +0200
fix example FTBFS
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git 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)