From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31866 invoked by alias); 18 Jul 2009 06:12:28 -0000 Received: (qmail 31856 invoked by uid 22791); 18 Jul 2009 06:12:28 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Jul 2009 06:12:21 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6I6CGkx003299; Sat, 18 Jul 2009 02:12:16 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6I6CFqv004686; Sat, 18 Jul 2009 02:12:15 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6I6CDmC014918; Sat, 18 Jul 2009 02:12:14 -0400 Message-ID: <4A6167BD.7080804@redhat.com> Date: Sat, 18 Jul 2009 18:00:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 MIME-Version: 1.0 To: Doug Evans CC: gdb-patches@sourceware.org Subject: Re: [RFA] Fix double free References: <4A610157.10201@redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090504040807050205000102" 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: 2009-07/txt/msg00447.txt.bz2 This is a multi-part message in MIME format. --------------090504040807050205000102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 355 On 07/17/2009 08:08 PM, Doug Evans wrote: > The problem occurs twice in reverse_search_command as well. Indeed it does! I did not even look! Updated patch attached. Keith ChangeLog 2009-07-17 Keith Seitz * source.c (forward_search_command): Don't fclose the stream, just run the cleanups. (reverse_search_command): Likewise. --------------090504040807050205000102 Content-Type: text/plain; name="cleanup-buglet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cleanup-buglet.patch" Content-length: 1246 Index: source.c =================================================================== RCS file: /cvs/src/src/gdb/source.c,v retrieving revision 1.102 diff -u -p -r1.102 source.c --- source.c 6 Jul 2009 18:23:47 -0000 1.102 +++ source.c 18 Jul 2009 05:54:17 -0000 @@ -1612,7 +1612,7 @@ forward_search_command (char *regex, int if (re_exec (buf) > 0) { /* Match! */ - fclose (stream); + do_cleanups (cleanups); print_source_lines (current_source_symtab, line, line + 1, 0); set_internalvar_integer (lookup_internalvar ("_"), line); current_source_line = max (line - lines_to_list / 2, 1); @@ -1690,7 +1690,7 @@ reverse_search_command (char *regex, int if (re_exec (buf) > 0) { /* Match! */ - fclose (stream); + do_cleanups (cleanups); print_source_lines (current_source_symtab, line, line + 1, 0); set_internalvar_integer (lookup_internalvar ("_"), line); current_source_line = max (line - lines_to_list / 2, 1); @@ -1699,7 +1699,7 @@ reverse_search_command (char *regex, int line--; if (fseek (stream, current_source_symtab->line_charpos[line - 1], 0) < 0) { - fclose (stream); + do_cleanups (cleanups); perror_with_name (current_source_symtab->filename); } } --------------090504040807050205000102--