Hi! In order to fix this very minor leak, we need a knob to free all cpp_dirs that were added. This adds a free_cpp_dirs() to gcc/incpath and needs review from some global maintainer or maybe libcpp maintainer for this hunk.
Bootstrapped and regtested on x86_64-unknown-linux without regressions. Ok for tunk? Bernhard Reutner-Fischer (2): Add free_cpp_dirs() Fortran: Fix memory leak in gfc_add_include_path [PR68800] gcc/fortran/cpp.c | 13 +++++++++++-- gcc/fortran/cpp.h | 1 + gcc/fortran/f95-lang.c | 2 +- gcc/fortran/scanner.c | 7 ++++--- gcc/incpath.c | 13 +++++++++++++ gcc/incpath.h | 1 + 6 files changed, 31 insertions(+), 6 deletions(-) -- 2.33.0