Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: msnyder@sonic.net
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] varobj.c, value_of_root, (another) memory leak
Date: Sat, 11 Aug 2007 01:40:00 -0000	[thread overview]
Message-ID: <18109.5009.554826.719365@kahikatea.snap.net.nz> (raw)
In-Reply-To: <16480.12.7.175.2.1186786910.squirrel@webmail.sonic.net>

 > I'm not totally sure about this -- does the return value of var_get_type
 > need to be freed?  If so, there are some other places in mi-cmd-var
 > where it isn't being.

Yes, I think this is right but USE_SELECTED_FRAME is broken anyway.  The
ones in mi-cmd-var.c may be more important.  Similar problems seem to
occur with varobj_get_expression and varobj_get_value. Since the expression
associated with a variable object doesn't change, I think c_name_of_variable
could just be:

static char *
c_name_of_variable (struct varobj *var)
{
  return var->name;
}

Are we close to release or branchpoint?  If not let's do these things now.
I also have a patch for editable/changeable properties of variable ojects
which I'd like to resubmit for approval if a release is no longer imminent.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


 > 2007-08-10  Michael Snyder  <msnyder@access-company.com>
 > 
 > 	* varobj.c (value_of_root): Memory leak.
 > 
 > Index: varobj.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/varobj.c,v
 > retrieving revision 1.90
 > diff -p -r1.90 varobj.c
 > *** varobj.c	8 Aug 2007 21:46:37 -0000	1.90
 > --- varobj.c	10 Aug 2007 22:58:51 -0000
 > *************** value_of_root (struct varobj **var_handl
 > *** 1741,1746 ****
 > --- 1741,1748 ----
 >   	  var = *var_handle;
 >   	  *type_changed = 1;
 >   	}
 > +       xfree (old_type);
 > +       xfree (new_type);
 >       }
 >     else
 >       {


  reply	other threads:[~2007-08-11  1:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 23:01 msnyder
2007-08-11  1:40 ` Nick Roberts [this message]
2007-08-11  2:41   ` Daniel Jacobowitz
2007-08-11 20:10     ` msnyder
2007-08-17 23:21   ` msnyder

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=18109.5009.554826.719365@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@sonic.net \
    /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