From c26363527485bf74fa0c5bfb9ecdb8553e2b6467 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 12 Nov 2001 21:20:18 +0000 Subject: Patch from Andreas Schwab : * eval.c (evaluate_subexp_standard): Fix memory leak: use alloca instead of xmalloc. --- gdb/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/eval.c') 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]); -- cgit v1.1