From patchwork Sat Oct 1 23:32:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 117280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9F564B6F76 for ; Sun, 2 Oct 2011 10:33:36 +1100 (EST) Received: (qmail 13518 invoked by alias); 1 Oct 2011 23:33:34 -0000 Received: (qmail 13509 invoked by uid 22791); 1 Oct 2011 23:33:33 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp209.alice.it (HELO smtp209.alice.it) (82.57.200.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Oct 2011 23:33:18 +0000 Received: from [192.168.1.4] (79.33.216.84) by smtp209.alice.it (8.5.124.08) id 4E850A860025E4DA; Sun, 2 Oct 2011 01:33:16 +0200 Message-ID: <4E87A2F2.4090506@oracle.com> Date: Sun, 02 Oct 2011 01:32:02 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110922 Thunderbird/7.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: "Joseph S. Myers" Subject: PR preprocessor/36819 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this minor issue remained open and miscategorized as C++ for many years. I changed it tentatively to preprocessor and I think we can easily resolve it as suggested by submitter: apparently there is a small memory leak happening at beginning of incpath.c:split_quote_chain, and the below seems the obvious way to plug it. Is it Ok for mainline? Thanks, Paolo. /////////////////////// 2011-10-01 Paolo Carlini PR preprocessor/36819 * incpath.c (merge_include_chains): Call free_path on heads[QUOTE] and tails[QUOTE]. Index: incpath.c =================================================================== --- incpath.c (revision 179416) +++ incpath.c (working copy) @@ -362,6 +362,8 @@ merge_include_chains (const char *sysroot, cpp_rea void split_quote_chain (void) { + free_path (heads[QUOTE], REASON_QUIET); + free_path (tails[QUOTE], REASON_QUIET); heads[QUOTE] = heads[BRACKET]; tails[QUOTE] = tails[BRACKET]; heads[BRACKET] = NULL;