qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Nikita Belov <zodiac@ispras.ru>
Cc: Vasily Efimov <real@ispras.ru>,
	Markus Armbruster <armbru@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Kirill Batuzov <batuzovk@ispras.ru>
Subject: Re: [Qemu-devel] [PATCH v2] hw/arm/realview.c: Fix memory leak in realview_init()
Date: Tue, 25 Nov 2014 14:47:12 +0000	[thread overview]
Message-ID: <CAFEAcA9ehmYjMJiA+rTW40GnVdRmoejCSs3h4_=mm8sVcLCDjA@mail.gmail.com> (raw)
In-Reply-To: <1416577889-18404-1-git-send-email-zodiac@ispras.ru>

On 21 November 2014 at 13:51, Nikita Belov <zodiac@ispras.ru> wrote:
> Variable 'ram_lo' is allocated unconditionally, but used only in some cases.
> When it is unused pointer will be lost at function exit, resulting in a
> memory leak. Allocate memory for 'ram_lo' only if it is needed.
>
> Valgrind output:
> ==16879== 240 bytes in 1 blocks are definitely lost in loss record 6,033 of 7,018
> ==16879==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16879==    by 0x33D2CE: malloc_and_trace (vl.c:2804)
> ==16879==    by 0x509E610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
> ==16879==    by 0x288836: realview_init (realview.c:55)
> ==16879==    by 0x28988C: realview_pb_a8_init (realview.c:375)
> ==16879==    by 0x341426: main (vl.c:4413)
>
> Signed-off-by: Nikita Belov <zodiac@ispras.ru>
> ---

Applied to target-arm.next; thanks.

-- PMM

      parent reply	other threads:[~2014-11-25 14:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 14:03 [Qemu-devel] [PATCH] hw/arm/realview.c: Fix memory leak in realview_init() Nikita Belov
2014-10-29 16:03 ` Peter Maydell
2014-10-31 10:42   ` Nikita Belov
2014-10-31 10:47     ` Peter Maydell
2014-10-31 12:32       ` Kirill Batuzov
2014-11-19 15:05 ` Nikita Belov
2014-11-19 15:08   ` Peter Maydell
2014-11-20 11:53     ` Kirill Batuzov
2014-11-20 12:00       ` Peter Maydell
2014-11-20 14:30         ` Kirill Batuzov
2014-11-20 15:27 ` Markus Armbruster
2014-11-21 13:51   ` [Qemu-devel] [PATCH v2] " Nikita Belov
2014-11-25 13:02     ` Markus Armbruster
2014-11-25 14:47     ` Peter Maydell [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='CAFEAcA9ehmYjMJiA+rTW40GnVdRmoejCSs3h4_=mm8sVcLCDjA@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=armbru@redhat.com \
    --cc=batuzovk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=real@ispras.ru \
    --cc=zodiac@ispras.ru \
    /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;
as well as URLs for NNTP newsgroup(s).