Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: teawater <teawater@gmail.com>
To: "Stan Shebs" <stan@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [multiprocess RFA] Fix memory leak of focus_command
Date: Thu, 27 Nov 2008 18:24:00 -0000	[thread overview]
Message-ID: <daef60380811262326y783fa4a3kf70bc94708b3caf9@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Hi Stan,

I found that focus_command doesn't free current_itset before overwrite
it. So I write a patch for it.

2008-11-27  Hui Zhu  <teawater@gmail.com>

	* infcmd.c (focus_command): Fix memory leak.

Thanks,
Hui

[-- Attachment #2: fix_focus_command_memory_leak.txt --]
[-- Type: text/plain, Size: 231 bytes --]

--- gdb.orig/infcmd.c
+++ gdb/infcmd.c
@@ -219,6 +219,8 @@
       return;
     }
 
+  if (current_itset)
+    xfree (current_itset);
   current_itset = itset;
 
   /* For now, set a current exec from the first element of the focus

             reply	other threads:[~2008-11-27  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27 18:24 teawater [this message]
2008-12-01 22:31 ` Michael Snyder
2008-12-01 22:39   ` Michael Snyder

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=daef60380811262326y783fa4a3kf70bc94708b3caf9@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=stan@codesourcery.com \
    /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