diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-11-12 21:20:18 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-11-12 21:20:18 +0000 |
commit | c26363527485bf74fa0c5bfb9ecdb8553e2b6467 (patch) | |
tree | 6b543befbe421d05623e7685c47d34b5449383bc /gdb/eval.c | |
parent | c26e46834fdfc080054fb546f879533daa5229da (diff) | |
download | gdb-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.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]); |