From 0dafbfbb9588b4e7966a2a19fceedccfb477ad91 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 24 Jan 2009 02:09:43 +0000 Subject: [PATCH] better --- src/examples/querystring_example.c | 2 ++ 1 file changed, 2 insertions(+) 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, *ptr = NULL; /* reset when done */ val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1); + if (me == NULL) + return MHD_NO; sprintf (me, fmt, "q", val); response = MHD_create_response_from_data (strlen (me), me, MHD_YES, MHD_NO); ret = MHD_queue_response (connection, MHD_HTTP_OK, response);