gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r28225 - libmicrohttpd/src/examples


From: gnunet
Subject: [GNUnet-SVN] r28225 - libmicrohttpd/src/examples
Date: Sun, 21 Jul 2013 18:18:43 +0200

Author: grothoff
Date: 2013-07-21 18:18:42 +0200 (Sun, 21 Jul 2013)
New Revision: 28225

Modified:
   libmicrohttpd/src/examples/post_example.c
Log:
add missing NULL checks in examples:


Modified: libmicrohttpd/src/examples/post_example.c
===================================================================
--- libmicrohttpd/src/examples/post_example.c   2013-07-21 16:05:48 UTC (rev 
28224)
+++ libmicrohttpd/src/examples/post_example.c   2013-07-21 16:18:42 UTC (rev 
28225)
@@ -284,6 +284,8 @@
   response = MHD_create_response_from_buffer (strlen (form),
                                              (void *) form,
                                              MHD_RESPMEM_PERSISTENT);
+  if (NULL == response)
+    return MHD_NO;
   add_session_cookie (session, response);
   MHD_add_response_header (response,
                           MHD_HTTP_HEADER_CONTENT_ENCODING,
@@ -316,6 +318,8 @@
   struct MHD_Response *response;
 
   reply = malloc (strlen (form) + strlen (session->value_1) + 1);
+  if (NULL == reply)
+    return NULL;
   snprintf (reply,
            strlen (form) + strlen (session->value_1) + 1,
            form,
@@ -324,6 +328,8 @@
   response = MHD_create_response_from_buffer (strlen (reply),
                                              (void *) reply,
                                              MHD_RESPMEM_MUST_FREE);
+  if (NULL == response)
+    return MHD_NO;
   add_session_cookie (session, response);
   MHD_add_response_header (response,
                           MHD_HTTP_HEADER_CONTENT_ENCODING,
@@ -356,6 +362,8 @@
   struct MHD_Response *response;
 
   reply = malloc (strlen (form) + strlen (session->value_1) + strlen 
(session->value_2) + 1);
+  if (NULL == reply)
+    return MHD_NO;
   snprintf (reply,
            strlen (form) + strlen (session->value_1) + strlen 
(session->value_2) + 1,
            form,
@@ -364,6 +372,8 @@
   response = MHD_create_response_from_buffer (strlen (reply),
                                              (void *) reply,
                                              MHD_RESPMEM_MUST_FREE);
+  if (NULL == response)
+    return MHD_NO;
   add_session_cookie (session, response);
   MHD_add_response_header (response,
                           MHD_HTTP_HEADER_CONTENT_ENCODING,
@@ -397,6 +407,8 @@
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
                                              (void *) NOT_FOUND_ERROR,
                                              MHD_RESPMEM_PERSISTENT);
+  if (NULL == response)
+    return MHD_NO;
   ret = MHD_queue_response (connection, 
                            MHD_HTTP_NOT_FOUND, 
                            response);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]