diff options
Diffstat (limited to 'src/examples/querystring_example.c')
-rw-r--r-- | src/examples/querystring_example.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/examples/querystring_example.c b/src/examples/querystring_example.c index d3b53693..a44a2786 100644 --- a/src/examples/querystring_example.c +++ b/src/examples/querystring_example.c | |||
@@ -54,6 +54,8 @@ ahc_echo (void *cls, | |||
54 | *ptr = NULL; /* reset when done */ | 54 | *ptr = NULL; /* reset when done */ |
55 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); | 55 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); |
56 | me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1); | 56 | me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1); |
57 | if (me == NULL) | ||
58 | return MHD_NO; | ||
57 | sprintf (me, fmt, "q", val); | 59 | sprintf (me, fmt, "q", val); |
58 | response = MHD_create_response_from_data (strlen (me), me, MHD_YES, MHD_NO); | 60 | response = MHD_create_response_from_data (strlen (me), me, MHD_YES, MHD_NO); |
59 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 61 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |