From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Andreas Schwab <schwab@suse.de>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Memory leak
Date: Thu, 01 Nov 2001 19:31:00 -0000 [thread overview]
Message-ID: <nppu6nk7m4.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: Andreas Schwab's message of 12 Nov 2001 17:54:19 +0100
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]
I've committed this change --- thanks!
Andreas Schwab <schwab@suse.de> writes:
>
> This patch fixes a memory leak.
>
> Andreas.
>
> 2001-11-12 Andreas Schwab <schwab@suse.de>
>
> * eval.c (evaluate_subexp_standard): Fix memory leak: use alloca
> instead of xmalloc.
>
> Index: eval.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/eval.c,v
> retrieving revision 1.15
> diff -u -a -u -r1.15 eval.c
> --- eval.c 2001/11/10 20:15:13 1.15
> +++ eval.c 2001/11/12 16:50:12
> @@ -839,7 +839,7 @@
> struct value *valp = NULL;
>
> /* Prepare list of argument types for overload resolution */
> - arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
> + arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
> for (ix = 1; ix <= nargs; ix++)
> arg_types[ix - 1] = VALUE_TYPE (argvec[ix]);
>
> @@ -888,7 +888,7 @@
> struct symbol *symp;
>
> /* Prepare list of argument types for overload resolution */
> - arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
> + arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
> for (ix = 1; ix <= nargs; ix++)
> arg_types[ix - 1] = VALUE_TYPE (argvec[ix]);
>
>
> --
> Andreas Schwab "And now for something
> Andreas.Schwab@suse.de completely different."
> SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
> Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
>
prev parent reply other threads:[~2001-11-12 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-01 14:28 Andreas Schwab
2001-11-01 19:31 ` Jim Blandy [this message]
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=nppu6nk7m4.fsf@zwingli.cygnus.com \
--to=jimb@zwingli.cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=schwab@suse.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