summaryrefslogtreecommitdiffstats
path: root/libcsoap/soap-env.c
diff options
context:
space:
mode:
authorGravatar snowdrop2006-02-27 22:26:01 +0000
committerGravatar snowdrop2006-02-27 22:26:01 +0000
commitb73c5d785a71edade3ba473cbb13ec57aaeec7ed (patch)
tree513989fcd640714bd6520d1d981aeb0bd391c267 /libcsoap/soap-env.c
parentc734a9e1a4fc7418911d8c50817d619221d2cd42 (diff)
downloadcsoap-b73c5d785a71edade3ba473cbb13ec57aaeec7ed.tar.gz
csoap-b73c5d785a71edade3ba473cbb13ec57aaeec7ed.tar.bz2
- removes a memleak in examples/csoap/simpleserver.c say_hello
- adds various malloc error messages - does some libcsoap/*.c #include fixups - removes a memleak in libcsoap/soap-server.c soap_server_entry - removes the double free of SoapCtx->action (again!!!) - rewrites more or less cleanly hsocket_close - adds volatile keywords for thread shared data items - _httpd_parse_arguments cleanup - rwerites the _httpd_connection initialization - adds a call to pthread_attr_destroy in httpd_session_main - fixes a wrong loop initialization in _httpd_wait_for_emtpy_conn - fixes a memleak in httpd_session_main (req) - more sophisticated httpd_server example - HTTP authentication SEGfault without password fixed
Diffstat (limited to 'libcsoap/soap-env.c')
-rw-r--r--libcsoap/soap-env.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libcsoap/soap-env.c b/libcsoap/soap-env.c
index cb55bd2..8f4df35 100644
--- a/libcsoap/soap-env.c
+++ b/libcsoap/soap-env.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-env.c,v 1.16 2006/02/25 10:09:28 snowdrop Exp $
+* $Id: soap-env.c,v 1.17 2006/02/27 22:26:02 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -21,11 +21,27 @@
*
* Email: ayaz@jprogrammer.net
******************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_STDARG_H
#include <stdarg.h>
+#endif
+
+#ifdef HAVE_STDIO_H
#include <stdio.h>
+#endif
+
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
-#include <libcsoap/soap-env.h>
+#include "soap-env.h"
#ifdef WIN32
#define USE_XMLSTRING
@@ -128,7 +144,11 @@ soap_env_new_from_doc(xmlDocPtr doc, SoapEnv ** out)
XML_ERROR_EMPTY_DOCUMENT, "XML Document is empty!");
}
- env = (SoapEnv *) malloc(sizeof(SoapEnv));
+ if (!(env = (SoapEnv *) malloc(sizeof(SoapEnv))))
+ {
+ log_error2("malloc failed (%s)", strerror(errno));
+ return herror_new("soap_env_from_doc", GENERAL_INVALID_PARAM, "malloc failed");
+ }
/* set root */
env->root = node;