mbox

[0/2] incpath, Fortran: Fix memory leak in gfc_add_include_path

Message ID 20211105211718.2261686-1-rep.dot.nop@gmail.com
Headers

Message

Bernhard Reutner-Fischer Nov. 5, 2021, 9:17 p.m. UTC
  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(-)