From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8113 invoked by alias); 10 Jul 2008 03:07:16 -0000 Received: (qmail 7962 invoked by uid 22791); 10 Jul 2008 03:07:15 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jul 2008 03:06:58 +0000 Received: by ti-out-0910.google.com with SMTP id d10so1232802tib.12 for ; Wed, 09 Jul 2008 20:06:55 -0700 (PDT) Received: by 10.110.52.1 with SMTP id z1mr4985617tiz.11.1215659215519; Wed, 09 Jul 2008 20:06:55 -0700 (PDT) Received: by 10.110.103.3 with HTTP; Wed, 9 Jul 2008 20:06:55 -0700 (PDT) Message-ID: Date: Thu, 10 Jul 2008 03:07:00 -0000 From: teawater To: "Joel Brobecker" Subject: Re: [patch]: Fix memory leak of symtab.c Cc: gdb-patches@sourceware.org In-Reply-To: <20080709171536.GE18019@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080709171536.GE18019@adacore.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00143.txt.bz2 OK. Thanks Joel. 2008-06-21 Hui Zhu * symtab.c (expand_line_sal): Fix a memory leak. --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4456,8 +4456,8 @@ expand_line_sal (struct symtab_and_line blocks -- for each PC found above we see if there are other PCs that are in the same block. If yes, the other PCs are filtered out. */ - filter = xmalloc (ret.nelts * sizeof (int)); - blocks = xmalloc (ret.nelts * sizeof (struct block *)); + filter = alloca (ret.nelts * sizeof (int)); + blocks = alloca (ret.nelts * sizeof (struct block *)); for (i = 0; i < ret.nelts; ++i) { filter[i] = 1; On Thu, Jul 10, 2008 at 01:15, Joel Brobecker wrote: >> 2008-06-21 Hui Zhu >> * symtab.c (expand_line_sal): Fix a memory leak. > > Yes, this is OK. (just make sure to have an empty line between the > ChangeLog header and the actual contents) > > Thank you! > > -- > Joel >