All of lore.kernel.org
 help / color / mirror / Atom feed
* Bad free() call
@ 2005-09-15  5:35 Joel Aelwyn
  0 siblings, 0 replies; only message in thread
From: Joel Aelwyn @ 2005-09-15  5:35 UTC (permalink / raw)
  To: mlmmj


[-- Attachment #1.1: Type: text/plain, Size: 1042 bytes --]

While poking around at writing a patch that supports per-list recipient 
delimiters (basically done, but needs testing under 'live fire' still), I came 
across a free() call that should be myfree() in prepstdreply.c (it isn't 
caught due to the fact that prepstdreply.c doesn't have any reason to #include 
mlmmj.h, where the automated warning about this lives). It's minor, but I 
figure that also makes it easy to apply until 1.2.9 comes out, for anyone that 
cares; patch attached.

Actually, having looked over prepstdreply.c further, I think I see quite a few 
memory leaks in the form of not calling myfree() at all, when something has 
been allocated, but several of them would be best handled (or at least, most 
simply handled) by rearranging the logic to not allocate things until needed - 
however, I don't feel competent enough with the codebase yet to try something 
of quite that magnitude. Well, not and post it in public without more testing 
than I have time to do right now, anyway...
-- 
Joel Aelwyn <joel@lightbearer.com>

[-- Attachment #1.2: myfree_biscuit.patch --]
[-- Type: text/plain, Size: 424 bytes --]

diff -urNad src/prepstdreply.c.orig src/prepstdreply.c
--- src/prepstdreply.c.orig	2005-01-15 10:46:24.000000000 +0000
+++ src/prepstdreply.c	2005-09-09 20:18:32.000000000 +0000
@@ -181,7 +181,7 @@
 	if(replyto) {
 		myreplyto = substitute(replyto, listaddr, tokencount, data);
 		tmp = concatstr(3, "Reply-To: ", myreplyto, "\n");
-		free(myreplyto);
+		myfree(myreplyto);
 		myreplyto = tmp;
 	} else
 		myreplyto = NULL;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-15  5:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-15  5:35 Bad free() call Joel Aelwyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.