Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: Hannes Domani <ssbssa@yahoo.de>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/3] solib_target_free_so memory leak
Date: Thu, 26 Dec 2019 22:55:00 -0000	[thread overview]
Message-ID: <CAPTJ0XGWmOm5f+7vzaOC=bri2nGai0q_=OFnCp3LVzi55UohnA@mail.gmail.com> (raw)
In-Reply-To: <20191224122452.1668-2-ssbssa@yahoo.de>

On Tue, Dec 24, 2019 at 1:25 PM Hannes Domani via gdb-patches
<gdb-patches@sourceware.org> wrote:
>
> gdb/ChangeLog:
>
> 2019-12-24  Hannes Domani  <ssbssa@yahoo.de>
>
>         * solib-target.c (solib_target_free_so): Free li->offsets.
> ---
>  gdb/solib-target.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gdb/solib-target.c b/gdb/solib-target.c
> index 2b473d6066..52e2a6068b 100644
> --- a/gdb/solib-target.c
> +++ b/gdb/solib-target.c
> @@ -293,6 +293,7 @@ solib_target_free_so (struct so_list *so)
>
>    gdb_assert (li->name.empty ());
>
> +  xfree (li->offsets);
>    delete li;

Maybe a better fix would be to change offsets to be a unique_xmalloc_ptr?

Christian


  reply	other threads:[~2019-12-26 22:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191224122452.1668-1-ssbssa.ref@yahoo.de>
2019-12-24 12:25 ` [PATCH 1/3] pe_bfd_read_buildid " Hannes Domani via gdb-patches
2019-12-24 12:25   ` [PATCH 2/3] solib_target_free_so " Hannes Domani via gdb-patches
2019-12-26 22:55     ` Christian Biesinger via gdb-patches [this message]
2020-01-03 16:41       ` Tom Tromey
2020-01-03 16:47         ` Hannes Domani via gdb-patches
2019-12-24 12:25   ` [PATCH 3/3] windows_clear_solib " Hannes Domani via gdb-patches
2020-01-03 16:44     ` Tom Tromey
2019-12-25 13:47   ` [PATCH 1/3] pe_bfd_read_buildid " Andrew Burgess
2019-12-25 14:14     ` Hannes Domani via gdb-patches
2019-12-27 16:46       ` Andrew Burgess

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='CAPTJ0XGWmOm5f+7vzaOC=bri2nGai0q_=OFnCp3LVzi55UohnA@mail.gmail.com' \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=ssbssa@yahoo.de \
    /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