Created attachment 2189 [details] fix Potential fix attached.
Unfortunately, it's not possible to safely free this here as pam_putenv() is underspecified: it is not guaranteed to either copy the environment it is setting or take over ownership of it. The safest behaviour here is just to accept the one-time leak :( I have added a comment to explain this in auth-pam.c
close bugs that were resolved in OpenSSH 8.5 release cycle