diff options
author | Harald Anlauf <anlauf@gmx.de> | 2023-02-24 19:56:32 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2023-02-24 20:48:33 +0100 |
commit | 45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3 (patch) | |
tree | b79fa87d820865d139e044cecc0eb2f286c8364e | |
parent | b31186e589caee43ac5720a538d9a41ebf514e81 (diff) | |
download | gcc-45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3.zip gcc-45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3.tar.gz gcc-45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3.tar.bz2 |
Fortran: frontend passes do_subscript leaks gmp memory [PR108924]
gcc/fortran/ChangeLog:
PR fortran/108924
* frontend-passes.cc (do_subscript): Clear used gmp variable.
-rw-r--r-- | gcc/fortran/frontend-passes.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc index 02fcb41..9042898 100644 --- a/gcc/fortran/frontend-passes.cc +++ b/gcc/fortran/frontend-passes.cc @@ -2883,7 +2883,10 @@ do_subscript (gfc_expr **e) have_do_end = false; if (!have_do_start && !have_do_end) - return 0; + { + mpz_clear (do_step); + return 0; + } /* No warning inside a zero-trip loop. */ if (have_do_start && have_do_end) |