diff mbox

PR preprocessor/36819

Message ID 4E87A2F2.4090506@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 1, 2011, 11:32 p.m. UTC
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  <paolo.carlini@oracle.com>

	PR preprocessor/36819
	* incpath.c (merge_include_chains): Call free_path on
	heads[QUOTE] and tails[QUOTE].

Comments

Joseph Myers Oct. 2, 2011, 12:20 p.m. UTC | #1
On Sun, 2 Oct 2011, Paolo Carlini wrote:

> 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?

OK.
diff mbox

Patch

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;