aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-11-12 21:20:18 +0000
committerJim Blandy <jimb@codesourcery.com>2001-11-12 21:20:18 +0000
commitc26363527485bf74fa0c5bfb9ecdb8553e2b6467 (patch)
tree6b543befbe421d05623e7685c47d34b5449383bc
parentc26e46834fdfc080054fb546f879533daa5229da (diff)
downloadgdb-c26363527485bf74fa0c5bfb9ecdb8553e2b6467.zip
gdb-c26363527485bf74fa0c5bfb9ecdb8553e2b6467.tar.gz
gdb-c26363527485bf74fa0c5bfb9ecdb8553e2b6467.tar.bz2
Patch from Andreas Schwab <schwab@suse.de>:
* eval.c (evaluate_subexp_standard): Fix memory leak: use alloca instead of xmalloc.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/eval.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8237646..dc28391 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2001-11-12 Jim Blandy <jimb@redhat.com>
+ Patch from Andreas Schwab <schwab@suse.de>:
+ * eval.c (evaluate_subexp_standard): Fix memory leak: use alloca
+ instead of xmalloc.
+
+2001-11-12 Jim Blandy <jimb@redhat.com>
+
* corefile.c (write_memory_unsigned_integer,
write_memory_signed_integer): New functions.
(write_memory): Move to be with other write_memory_* functions.
diff --git a/gdb/eval.c b/gdb/eval.c
index 3b1a06c..c15b236 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -839,7 +839,7 @@ evaluate_subexp_standard (struct type *expect_type,
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 @@ evaluate_subexp_standard (struct type *expect_type,
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]);