From 2f5de47d0b100194d42e6ae9d17a994e8203da0d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 18 Dec 2003 23:04:23 +0000 Subject: [PATCH] Fix memory leak in SRW/SRU encoding handler --- src/soap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/soap.c b/src/soap.c index ebcf158..64310bc 100644 --- a/src/soap.c +++ b/src/soap.c @@ -2,7 +2,7 @@ * Copyright (c) 2002-2003, Index Data. * See the file LICENSE for details. * - * $Id: soap.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + * $Id: soap.c,v 1.2 2003-12-18 23:04:23 adam Exp $ */ #include @@ -204,7 +204,11 @@ int z_soap_codec_enc(ODR o, Z_SOAP **pp, handlers[no].client_data, handlers[no].ns); if (ret) + { + xmlFreeNode(envelope_ptr); + xmlFreeDoc(doc); return ret; + } } if (p->which == Z_SOAP_generic && !strcmp(p->ns, "SRU")) { @@ -223,6 +227,7 @@ int z_soap_codec_enc(ODR o, Z_SOAP **pp, memcpy(*content_buf, buf_out, len_out); xmlFree(buf_out); } + xmlFreeNode(envelope_ptr); xmlFreeDoc(doc); return 0; } -- 1.7.10.4