From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/3] Fix memory leak in guess_from_received_header().
Date: Wed, 15 Jun 2011 15:12:13 +0400 [thread overview]
Message-ID: <1308136334-9219-2-git-send-email-dmitry.kurochkin@gmail.com> (raw)
In-Reply-To: <1308136334-9219-1-git-send-email-dmitry.kurochkin@gmail.com>
Mta variable was not free()d in one case.
---
notmuch-reply.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/notmuch-reply.c b/notmuch-reply.c
index dab69e6..64f70bf 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -401,8 +401,10 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
break;
mta = xstrdup (by);
token = strtok(mta," \t");
- if (token == NULL)
+ if (token == NULL) {
+ free (mta);
break;
+ }
/* Now extract the last two components of the MTA host name
* as domain and tld.
*/
--
1.7.5.4
next prev parent reply other threads:[~2011-06-15 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 11:12 [PATCH 1/3] Fix double free in guess_from_received_header() Dmitry Kurochkin
2011-06-15 11:12 ` Dmitry Kurochkin [this message]
2011-06-15 11:12 ` [PATCH 3/3] Fix indentation " Dmitry Kurochkin
2011-06-15 14:08 ` [PATCH 1/3] Fix double free " Carl Worth
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308136334-9219-2-git-send-email-dmitry.kurochkin@gmail.com \
--to=dmitry.kurochkin@gmail.com \
--cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).