From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11050 invoked by alias); 12 Nov 2001 16:54:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10901 invoked from network); 12 Nov 2001 16:54:21 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sourceware.cygnus.com with SMTP; 12 Nov 2001 16:54:21 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 882061E2D4 for ; Mon, 12 Nov 2001 17:54:20 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: gdb-patches@sources.redhat.com Subject: Memory leak X-Yow: I predict that by 1993 everyone will live in and around LAS VEGAS and wear BEATLE HAIRCUTS! From: Andreas Schwab Date: Thu, 01 Nov 2001 14:28:00 -0000 Message-ID: User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2001-11/txt/msg00009.txt.bz2 This patch fixes a memory leak. Andreas. 2001-11-12 Andreas Schwab * eval.c (evaluate_subexp_standard): Fix memory leak: use alloca instead of xmalloc. Index: eval.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D NULL; =20 /* Prepare list of argument types for overload resolution */ - arg_types =3D (struct type **) xmalloc (nargs * (sizeof (struct typ= e *))); + arg_types =3D (struct type **) alloca (nargs * (sizeof (struct type= *))); for (ix =3D 1; ix <=3D nargs; ix++) arg_types[ix - 1] =3D VALUE_TYPE (argvec[ix]); =20 @@ -888,7 +888,7 @@ struct symbol *symp; =20 /* Prepare list of argument types for overload resolution */ - arg_types =3D (struct type **) xmalloc (nargs * (sizeof (struct typ= e *))); + arg_types =3D (struct type **) alloca (nargs * (sizeof (struct type= *))); for (ix =3D 1; ix <=3D nargs; ix++) arg_types[ix - 1] =3D VALUE_TYPE (argvec[ix]); =20 --=20 Andreas Schwab "And now for something Andreas.Schwab@suse.de completely different." SuSE Labs, SuSE GmbH, Schanz=E4ckerstr. 10, D-90443 N=FCrnberg Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5