W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2006

Patch - plug a memory leak

From: Sam Varshavchik <mrsam@courier-mta.com>
Date: Sun, 09 Jul 2006 17:14:17 -0400
Message-ID: <cone.1152479657.802409.6442.500@commodore.email-scan.com>
To: www-lib@w3.org
valgrind comes back with a memory leak in the new version of HTBound.c. When 
I rewrote HTBound.c last year, I copied some snippets from the old version 
into the new version on HTBound.c, I guess without fully understanding other 
parts of libwww.  Can't really say for sure, but the old HTBound.c might've 
also been leaking in the same spot.  The analogous HTStreamStack call in the 
old HTBound.c had the same parameters.

Anyway, this patch makes valgrind happy.  Perhaps someone who's more 
familiar with HTMerge can share a comment, here.


Index: Library/src/HTBound.c
===================================================================
RCS file: /cvsroot/lpmtool/libwww/Library/src/HTBound.c,v
retrieving revision 1.2
diff -U3 -r1.2 HTBound.c
--- Library/src/HTBound.c	5 Jan 2006 01:27:20 -0000	1.2
+++ Library/src/HTBound.c	9 Jul 2006 20:59:16 -0000
@@ -410,7 +410,7 @@
 
 	if (!isterminal)
 		me->target = HTStreamStack(WWW_MIME,me->format,
-					   HTMerge(me->orig_target, 2),
+					   HTMerge(me->orig_target, 1),
 					   me->request, YES);
 }
 


Received on Sunday, 9 July 2006 21:14:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:45 GMT