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.carl...@oracle.com>

        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;

Reply via email to