diff options
author | Christian Grothoff <christian@grothoff.org> | 2007-12-30 20:08:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2007-12-30 20:08:22 +0000 |
commit | c2968619ef48cd5cfa9de2e07b1db0007ba395f4 (patch) | |
tree | 8b34d1426356195df124acc375911f7fbad2dfc2 | |
parent | 435bef8e63a33d0ed303edd2a0dc89574174ddd5 (diff) | |
download | libmicrohttpd-c2968619ef48cd5cfa9de2e07b1db0007ba395f4.tar.gz libmicrohttpd-c2968619ef48cd5cfa9de2e07b1db0007ba395f4.zip |
docs and bugfixes
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | src/daemon/daemon.c | 5 | ||||
-rw-r--r-- | src/daemon/minimal_example.c | 3 | ||||
-rw-r--r-- | src/daemon/response.c | 7 |
4 files changed, 17 insertions, 1 deletions
@@ -7,3 +7,6 @@ Elliot Glaysher | |||
7 | Daniel Pittman <depittman@gmail.com> | 7 | Daniel Pittman <depittman@gmail.com> |
8 | Nils Durner <durner@gnunet.org> | 8 | Nils Durner <durner@gnunet.org> |
9 | Heikki Lindholm <holindho@cs.helsinki.fi> | 9 | Heikki Lindholm <holindho@cs.helsinki.fi> |
10 | |||
11 | Documentation contributions also came from: | ||
12 | 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, | |||
596 | return NULL; | 596 | return NULL; |
597 | } | 597 | } |
598 | retVal = malloc (sizeof (struct MHD_Daemon)); | 598 | retVal = malloc (sizeof (struct MHD_Daemon)); |
599 | if (retVal == NULL) | ||
600 | { | ||
601 | CLOSE(socket_fd); | ||
602 | return NULL; | ||
603 | } | ||
599 | memset (retVal, 0, sizeof (struct MHD_Daemon)); | 604 | memset (retVal, 0, sizeof (struct MHD_Daemon)); |
600 | retVal->options = options; | 605 | retVal->options = options; |
601 | retVal->port = port; | 606 | 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, | |||
40 | struct MHD_Connection *connection, | 40 | struct MHD_Connection *connection, |
41 | const char *url, | 41 | const char *url, |
42 | const char *method, | 42 | const char *method, |
43 | const char *version, | ||
43 | const char *upload_data, | 44 | const char *upload_data, |
44 | const char *version, unsigned int *upload_data_size, void **ptr) | 45 | unsigned int *upload_data_size, void **ptr) |
45 | { | 46 | { |
46 | static int aptr; | 47 | static int aptr; |
47 | const char *me = cls; | 48 | 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, | |||
226 | if ((data == NULL) && (size > 0)) | 226 | if ((data == NULL) && (size > 0)) |
227 | return NULL; | 227 | return NULL; |
228 | retVal = malloc (sizeof (struct MHD_Response)); | 228 | retVal = malloc (sizeof (struct MHD_Response)); |
229 | if (retVal == NULL) | ||
230 | return NULL; | ||
229 | memset (retVal, 0, sizeof (struct MHD_Response)); | 231 | memset (retVal, 0, sizeof (struct MHD_Response)); |
230 | if (pthread_mutex_init (&retVal->mutex, NULL) != 0) | 232 | if (pthread_mutex_init (&retVal->mutex, NULL) != 0) |
231 | { | 233 | { |
@@ -235,6 +237,11 @@ MHD_create_response_from_data (size_t size, | |||
235 | if ((must_copy) && (size > 0)) | 237 | if ((must_copy) && (size > 0)) |
236 | { | 238 | { |
237 | tmp = malloc (size); | 239 | tmp = malloc (size); |
240 | if (tmp == NULL) | ||
241 | { | ||
242 | free(retVal); | ||
243 | return NULL; | ||
244 | } | ||
238 | memcpy (tmp, data, size); | 245 | memcpy (tmp, data, size); |
239 | must_free = 1; | 246 | must_free = 1; |
240 | data = tmp; | 247 | data = tmp; |