From: Daniel Jacobowitz <drow@mvista.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com, ezannoni@redhat.com
Subject: Re: RFA: Correct field names for class methods
Date: Wed, 28 Aug 2002 11:36:00 -0000 [thread overview]
Message-ID: <20020828173429.GA5873@nevyn.them.org> (raw)
In-Reply-To: <ro1ofbmhp8l.fsf@jackfruit.Stanford.EDU>
On Wed, Aug 28, 2002 at 10:23:06AM -0700, David Carlton wrote:
> In article <20020827031346.GA16591@nevyn.them.org>, Daniel Jacobowitz
> <drow@mvista.com> writes:
>
> > +void
> > +update_method_name_from_physname (char **old_name, char *physname)
> > +{
> > + char *method_name;
> > +
> > + method_name = method_name_from_physname (physname);
> > +
> > + if (method_name == NULL)
> > + error ("bad physname %s\n", physname);
> > +
> > + if (strcmp (*old_name, method_name) != 0)
> > + *old_name = method_name;
> > + else
> > + xfree (method_name);
> > +}
>
> I'm pretty sure this is a memory leak. How about replacing the last
> if clause by
>
> xfree(*old_name);
> *old_name = method_name;
>
> That should get rid of the memory leak and avoid a superfluous
> strcmp.
No can do. Look at where TYPE_NAME is allocated; sometimes (often?
Not sure.) it is on the obstack. We're not consistent about that. We
need to be, someday, but that's a separate cleanup.
> (Also, the ChangeLog entry has the name of this function written
> incorrectly.)
Oops, thanks!
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-08-28 17:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-26 20:30 Daniel Jacobowitz
2002-08-28 10:26 ` David Carlton
2002-08-28 11:36 ` Daniel Jacobowitz [this message]
2002-08-28 11:50 ` David Carlton
2002-08-29 21:07 ` Jim Blandy
2002-08-30 0:14 ` Daniel Jacobowitz
2002-09-09 16:32 ` Elena Zannoni
2002-09-10 9:49 ` Daniel Jacobowitz
2002-09-10 15:15 ` Elena Zannoni
2002-09-10 15:20 ` Daniel Jacobowitz
2002-09-13 11:30 ` Elena Zannoni
2002-09-13 19:11 ` Daniel Jacobowitz
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=20020828173429.GA5873@nevyn.them.org \
--to=drow@mvista.com \
--cc=carlton@math.stanford.edu \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.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