From: Joel Aelwyn <joel@lightbearer.com>
To: mlmmj@mlmmj.org
Subject: Bad free() call
Date: Thu, 15 Sep 2005 05:35:50 +0000 [thread overview]
Message-ID: <43290836.70000@lightbearer.com> (raw)
[-- 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 --]
reply other threads:[~2005-09-15 5:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43290836.70000@lightbearer.com \
--to=joel@lightbearer.com \
--cc=mlmmj@mlmmj.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.