Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pingfan Liu <piliu@redhat.com>
To: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads()
Date: Wed, 22 Mar 2017 03:18:09 -0400 (EDT)	[thread overview]
Message-ID: <1770021705.4797769.1490167089259.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <0910DD04CBD6DE4193FCF86B9C00BE9701EBA7FF@BPXM01GP.gisp.nec.co.jp>





----- Original Message -----
> From: "Atsushi Kumagai" <ats-kumagai@wm.jp.nec.com>
> To: "Pingfan Liu" <piliu@redhat.com>
> Cc: kexec@lists.infradead.org
> Sent: Wednesday, March 22, 2017 2:59:29 PM
> Subject: RE: [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads()
> 
> Hello Pingfan,
> 
> It would be helpful if you could mention that the patch is for
> makedumpfile when you post that, otherwise I could overlook that.
> 
Sorry, and I will add such info.

Regards,
Pingfan

> Anyway, I'll merge this patch into v1.6.2 after adding semicolon
> to the back of "free(pls)".
> 
> Thanks,
> Atsushi Kumagai
> 
> >Signed-off-by: Pingfan Liu <piliu@redhat.com>
> >---
> > elf_info.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> >diff --git a/elf_info.c b/elf_info.c
> >index d84553a..35e754b 100644
> >--- a/elf_info.c
> >+++ b/elf_info.c
> >@@ -893,12 +893,14 @@ int get_kcore_dump_loads(void)
> > 				|| !is_phys_addr(p->virt_start))
> > 			continue;
> > 		if (j >= loads)
> >+			free(pls)
> > 			return FALSE;
> >
> > 		if (j == 0) {
> > 			offset_pt_load_memory = p->file_offset;
> > 			if (offset_pt_load_memory == 0) {
> > 				ERRMSG("Can't get the offset of page data.\n");
> >+				free(pls)
> > 				return FALSE;
> > 			}
> > 		}
> >--
> >2.7.4
> >
> >
> >_______________________________________________
> >kexec mailing list
> >kexec@lists.infradead.org
> >http://lists.infradead.org/mailman/listinfo/kexec
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2017-03-22  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21  3:28 [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads() Pingfan Liu
2017-03-22  6:59 ` Atsushi Kumagai
2017-03-22  7:18   ` Pingfan Liu [this message]

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=1770021705.4797769.1490167089259.JavaMail.zimbra@redhat.com \
    --to=piliu@redhat.com \
    --cc=ats-kumagai@wm.jp.nec.com \
    --cc=kexec@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox