]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: fix memory leak with real to integer conversion warning
authorHarald Anlauf <anlauf@gmx.de>
Sat, 25 Feb 2023 18:05:38 +0000 (19:05 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 25 Feb 2023 18:05:38 +0000 (19:05 +0100)
gcc/fortran/ChangeLog:

* arith.cc (gfc_real2int): Clear mpfr variable after use.

gcc/fortran/arith.cc

index d0d1c0b03d225f3914cb75af07d676e6cd354d09..37aeaf1b186ff75984f025229b7c2c10be1ea970 100644 (file)
@@ -2257,6 +2257,7 @@ gfc_real2int (gfc_expr *src, int kind)
                           gfc_typename (&result->ts), &src->where);
          did_warn = true;
        }
+      mpfr_clear (f);
     }
   if (!did_warn && warn_conversion_extra)
     {