From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] win32-nat printf and sprintf removal
Date: Thu, 14 Feb 2002 03:36:00 -0000 [thread overview]
Message-ID: <4.2.0.58.20020214123355.0169bfe0@ics.u-strasbg.fr> (raw)
In-Reply-To: <4.2.0.58.20020214121240.01a80208@ics.u-strasbg.fr>
> > >@@ -2009,7 +2009,7 @@ _initialize_check_for_gdb_ini (void)
> > > {
> > > int len = strlen (oldini);
> > > char *newini = alloca (len + 1);
> > >- sprintf (newini, "%.*s.gdbinit",
> > >+ xasprintf (newini, "%.*s.gdbinit",
> > > (int) (len - (sizeof ("gdb.ini") - 1)), oldini);
> > > warning ("obsolete '%s' found. Rename to '%s'.", oldini, newini);
> > > }
>
> I corrected this one to this patch,
>which doesn't give any warning.
>But the memory allocated for oldini is still lost....
Whoops, once again, I clearly show my lack of C knowledge....
oldini is set by using alloca, and I just discovered that alloca
function does automatic disposal of the memory allocated at function exit.
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
next prev parent reply other threads:[~2002-02-14 11:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-08 9:29 Pierre Muller
2002-02-08 11:00 ` Andrew Cagney
2002-02-08 11:34 ` muller
2002-02-08 15:04 ` Christopher Faylor
2002-02-08 15:17 ` Martin M. Hunt
2002-02-08 15:48 ` Martin M. Hunt
2002-02-14 3:17 ` Pierre Muller
2002-02-14 3:36 ` Pierre Muller [this message]
2002-02-14 7:31 ` Andrew Cagney
2002-02-14 8:13 ` Christopher Faylor
2002-02-14 8:44 ` Pierre Muller
2002-02-14 8:49 ` Christopher Faylor
2002-02-14 7:59 ` Christopher Faylor
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=4.2.0.58.20020214123355.0169bfe0@ics.u-strasbg.fr \
--to=muller@cerbere.u-strasbg.fr \
--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