diff options
Diffstat (limited to 'src/microhttpd/postprocessor.c')
-rw-r--r-- | src/microhttpd/postprocessor.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c index 287e03a2..cf3c31ec 100644 --- a/src/microhttpd/postprocessor.c +++ b/src/microhttpd/postprocessor.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "internal.h" | 26 | #include "internal.h" |
27 | #include "mhd_str.h" | 27 | #include "mhd_str.h" |
28 | #include "mhd_compat.h" | ||
28 | 29 | ||
29 | /** | 30 | /** |
30 | * Size of on-stack buffer that we use for un-escaping of the value. | 31 | * Size of on-stack buffer that we use for un-escaping of the value. |
@@ -325,11 +326,8 @@ MHD_create_post_processor (struct MHD_Connection *connection, | |||
325 | buffer_size += 4; /* round up to get nice block sizes despite boundary search */ | 326 | buffer_size += 4; /* round up to get nice block sizes despite boundary search */ |
326 | 327 | ||
327 | /* add +1 to ensure we ALWAYS have a zero-termination at the end */ | 328 | /* add +1 to ensure we ALWAYS have a zero-termination at the end */ |
328 | if (NULL == (ret = malloc (sizeof (struct MHD_PostProcessor) + buffer_size + 1))) | 329 | if (NULL == (ret = MHD_calloc_ (1, sizeof (struct MHD_PostProcessor) + buffer_size + 1))) |
329 | return NULL; | 330 | return NULL; |
330 | memset (ret, | ||
331 | 0, | ||
332 | sizeof (struct MHD_PostProcessor) + buffer_size + 1); | ||
333 | ret->connection = connection; | 331 | ret->connection = connection; |
334 | ret->ikvi = iter; | 332 | ret->ikvi = iter; |
335 | ret->cls = iter_cls; | 333 | ret->cls = iter_cls; |