diff options
author | snowdrop | 2006-02-27 22:26:01 +0000 |
---|---|---|
committer | snowdrop | 2006-02-27 22:26:01 +0000 |
commit | b73c5d785a71edade3ba473cbb13ec57aaeec7ed (patch) | |
tree | 513989fcd640714bd6520d1d981aeb0bd391c267 /libcsoap/soap-ctx.c | |
parent | c734a9e1a4fc7418911d8c50817d619221d2cd42 (diff) | |
download | csoap-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-ctx.c')
-rwxr-xr-x | libcsoap/soap-ctx.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/libcsoap/soap-ctx.c b/libcsoap/soap-ctx.c index dd68861..a06b897 100755 --- a/libcsoap/soap-ctx.c +++ b/libcsoap/soap-ctx.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: soap-ctx.c,v 1.8 2006/02/18 20:14:36 snowdrop Exp $ + * $Id: soap-ctx.c,v 1.9 2006/02/27 22:26:02 snowdrop Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003-2004 Ferhat Ayaz @@ -21,14 +21,35 @@ * * Email: ferhatayaz@jprogrammer.net ******************************************************************/ +#ifdef HAVE_CONFIG_H +#include <config.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-ctx.h> +#include "soap-ctx.h" SoapCtx * soap_ctx_new(SoapEnv * env) /* should only be used internally */ { - SoapCtx *ctx = (SoapCtx *) malloc(sizeof(SoapCtx)); + SoapCtx *ctx; + + if (!(ctx = (SoapCtx *) malloc(sizeof(SoapCtx)))) + { + log_error2("malloc failed (%s)", strerror(errno)); + return NULL; + } + ctx->env = env; ctx->attachments = NULL; ctx->action = NULL; @@ -132,12 +153,16 @@ soap_ctx_free(SoapCtx * ctx) if (ctx->attachments) attachments_free(ctx->attachments); + if (ctx->env) soap_env_free(ctx->env); + if (ctx->action) free(ctx->action); free(ctx); + + return; } |