summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2007-12-30 20:08:22 +0000
committerChristian Grothoff <christian@grothoff.org>2007-12-30 20:08:22 +0000
commitc2968619ef48cd5cfa9de2e07b1db0007ba395f4 (patch)
tree8b34d1426356195df124acc375911f7fbad2dfc2
parent435bef8e63a33d0ed303edd2a0dc89574174ddd5 (diff)
docs and bugfixes
-rw-r--r--AUTHORS3
-rw-r--r--src/daemon/daemon.c5
-rw-r--r--src/daemon/minimal_example.c3
-rw-r--r--src/daemon/response.c7
4 files changed, 17 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index d878ee11..0fde4c40 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,3 +7,6 @@ Elliot Glaysher
Daniel Pittman <depittman@gmail.com>
Nils Durner <durner@gnunet.org>
Heikki Lindholm <holindho@cs.helsinki.fi>
+
+Documentation contributions also came from:
+Marco Maggi <marco.maggi-ipsu@poste.it>
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 6a0e4ab2..93017ae3 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -596,6 +596,11 @@ MHD_start_daemon (unsigned int options,
return NULL;
}
retVal = malloc (sizeof (struct MHD_Daemon));
+ if (retVal == NULL)
+ {
+ CLOSE(socket_fd);
+ return NULL;
+ }
memset (retVal, 0, sizeof (struct MHD_Daemon));
retVal->options = options;
retVal->port = port;
diff --git a/src/daemon/minimal_example.c b/src/daemon/minimal_example.c
index 68b4a3d6..0cbf3a14 100644
--- a/src/daemon/minimal_example.c
+++ b/src/daemon/minimal_example.c
@@ -40,8 +40,9 @@ ahc_echo (void *cls,
struct MHD_Connection *connection,
const char *url,
const char *method,
+ const char *version,
const char *upload_data,
- const char *version, unsigned int *upload_data_size, void **ptr)
+ unsigned int *upload_data_size, void **ptr)
{
static int aptr;
const char *me = cls;
diff --git a/src/daemon/response.c b/src/daemon/response.c
index 160246eb..ea1fe9c0 100644
--- a/src/daemon/response.c
+++ b/src/daemon/response.c
@@ -226,6 +226,8 @@ MHD_create_response_from_data (size_t size,
if ((data == NULL) && (size > 0))
return NULL;
retVal = malloc (sizeof (struct MHD_Response));
+ if (retVal == NULL)
+ return NULL;
memset (retVal, 0, sizeof (struct MHD_Response));
if (pthread_mutex_init (&retVal->mutex, NULL) != 0)
{
@@ -235,6 +237,11 @@ MHD_create_response_from_data (size_t size,
if ((must_copy) && (size > 0))
{
tmp = malloc (size);
+ if (tmp == NULL)
+ {
+ free(retVal);
+ return NULL;
+ }
memcpy (tmp, data, size);
must_free = 1;
data = tmp;