]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: fix frontend memleak
authorHarald Anlauf <anlauf@gmx.de>
Sun, 12 May 2024 19:48:03 +0000 (21:48 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sun, 12 May 2024 19:48:03 +0000 (21:48 +0200)
gcc/fortran/ChangeLog:

* primary.cc (gfc_match_varspec): Replace 'ref' argument to
is_inquiry_ref() by NULL when the result is not needed to avoid
a memleak.

gcc/fortran/primary.cc

index 606e84432be6b21d9227b8d5afa6ee746825ed8d..8e7833769a8f4e893b655491740ec3e70d2d0a91 100644 (file)
@@ -2250,7 +2250,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
         can be found.  If this was an inquiry reference with the same name
         as a derived component and the associate-name type is not derived
         or class, this is fixed up in 'gfc_fixup_inferred_type_refs'.  */
-      if (mm == MATCH_YES && is_inquiry_ref (name, &tmp)
+      if (mm == MATCH_YES && is_inquiry_ref (name, NULL)
          && !(sym->ts.type == BT_UNKNOWN
                && gfc_find_derived_types (sym, gfc_current_ns, name)))
        inquiry = true;