From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D9713858CDB; Sun, 12 Mar 2023 10:48:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D9713858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678618116; bh=xlZqXZqSFlwk/tlrgWLjJQp8V3JDp3BKuoc0nNeyMRE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M9WEQn7r3SLz2vK5aWuKcWYY7sW0duWc56I/2LF7sWYALr9bXcFX4Y6Q6ycqqGTCs kjFwhyEkgWqIqwsKaQTiyFno0cY1RTdZr2FPsXw1uTmP5swgyrn0nEgKijWacScH2s 9GgHePf5RBxZUmmNeQKW4EM+Ix3amXbbNNF0N8IE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/108923] memory leak of get_intrinsic_dummy_arg result Date: Sun, 12 Mar 2023 10:48:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mikael at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108923 --- Comment #9 from CVS Commits --- The releases/gcc-12 branch has been updated by Mikael Morin : https://gcc.gnu.org/g:7b0c9631ccb492c4457a91dbb91e7a5bcd0bc2a6 commit r12-9244-g7b0c9631ccb492c4457a91dbb91e7a5bcd0bc2a6 Author: Mikael Morin Date: Sat Feb 25 21:37:46 2023 +0100 fortran: Reuse associated_dummy memory if previously allocated [PR10892= 3] This avoids making the associted_dummy field point to a new memory chunk if it's already pointing somewhere, in which case doing so would leak t= he previously allocated chunk. PR fortran/108923 gcc/fortran/ChangeLog: * intrinsic.cc (get_intrinsic_dummy_arg, set_intrinsic_dummy_arg): Rename the former to the latter. Remove the return value, add a reference to the lhs as argument, and do the pointer assignment inside the function. Don't do it if the pointer is already non-NULL. (sort_actual): Update caller. (cherry picked from commit 5c638095e7e0fa4de4e4f7326384a86830b25732)=