]> git.ipfire.org Git - people/ms/gcc.git/commit
fortran: Plug leak of associated_dummy memory. [PR108923]
authorMikael Morin <mikael@gcc.gnu.org>
Fri, 24 Feb 2023 21:11:17 +0000 (22:11 +0100)
committerMikael Morin <mikael@gcc.gnu.org>
Sun, 12 Mar 2023 09:34:14 +0000 (10:34 +0100)
commitcd65c727fd6d5a252964dbeb3a735daa0a521a89
tree5915eb3f92a0998ac4bf2958ffb13a08bb81502c
parent18dee4a183ae4e795c9e64df0cc4ab6b8932731a
fortran: Plug leak of associated_dummy memory. [PR108923]

This fixes a memory leak by accompanying the release of
gfc_actual_arglist elements' memory with a release of the
associated_dummy field memory (if allocated).
Actual argument copy is adjusted as well so that each copy can free
its field independently.

PR fortran/108923

gcc/fortran/ChangeLog:

* expr.cc (gfc_free_actual_arglist): Free associated_dummy
memory.
(gfc_copy_actual_arglist): Make a copy of the associated_dummy
field if it is set in the original element.

(cherry picked from commit 24c9edfa73632276d7698c103f35833f29804d98)
gcc/fortran/expr.cc