--------------------- PatchSet 6036 Date: 2003/11/14 17:28:46 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: fix a memory leak Members: src/icap_respmod.c:1.1.2.24->1.1.2.25 Index: squid/src/icap_respmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_respmod.c,v retrieving revision 1.1.2.24 retrieving revision 1.1.2.25 diff -u -r1.1.2.24 -r1.1.2.25 --- squid/src/icap_respmod.c 14 Nov 2003 02:09:22 -0000 1.1.2.24 +++ squid/src/icap_respmod.c 14 Nov 2003 17:28:46 -0000 1.1.2.25 @@ -1,5 +1,5 @@ /* - * $Id: icap_respmod.c,v 1.1.2.24 2003/11/14 02:09:22 dwsquid Exp $ + * $Id: icap_respmod.c,v 1.1.2.25 2003/11/14 17:28:46 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -219,6 +219,7 @@ if (0 == icap->sc) { /* check again; bail if we're not ready to send ICAP/HTTP hdrs */ debug(81, 5) ("icapSendRespMod: dont have full HTTP response hdrs\n"); + memBufClean(&mb); return; } #if ICAP_PREVIEW @@ -317,14 +318,13 @@ } commSetTimeout(icap->icap_fd, -1, NULL, NULL); - if (mb.size) { -#if 1 - debug(81, 5) ("icapSendRespMod: FD %d writing {%s}\n", icap->icap_fd, mb.buf); -#endif - icap->flags.write_pending = 1; - comm_write_mbuf(icap->icap_fd, mb, icapSendRespModDone, icap); + if (!mb.size) { + memBufClean(&mb); + return; } - return; + debug(81, 5) ("icapSendRespMod: FD %d writing {%s}\n", icap->icap_fd, mb.buf); + icap->flags.write_pending = 1; + comm_write_mbuf(icap->icap_fd, mb, icapSendRespModDone, icap); } static void