Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 97923

Summary: fix several memory leaks in pam
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: pamAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: michael, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pam-0.77-66 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-16 17:47:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 100644    
Attachments:
Description Flags
fix several memory leaks in pam none

Description Jonathan Kamens 2003-06-24 04:13:22 UTC
Note that I am filing this bug against Rawhide since that's where I got the bits
installed on this machine, but it's pretty much a sure thing that the bugs for
which I'm supplying patches are also present in non-Rawhide releases, since I've
been seeing memory leaks in xscreensaver/pam for a Long Time.

I finally got annoyed enough by xscreensaver growing without bound as I use it
to lock/unlock the screen multiple times, that I put in the effort to track down
all the memory leaks causing this behavior.  It appears that all of them were
inside pam, hence the attached patch, which fixes the following leaks:

* The macro which defines numerous thread-safe wrappers to various get*ent
functions does not free the buffer it had allocated if the function it's
wrapping fails.

* The pam_stack module allocates memory to hold a service name which is not freed.

* The pam_stack modules allocates memory to hold an environment list which is
not freed.  Note that to fix this leak, I had to add a utility function for
freeing an environment list.  Another version of this function was already
present in the pam_misc library, but since most pam programs don't link against
pam_misc, I didn't want to depend on that version of the function.

I have not sent this patch to the upstream maintainer, because Red Hat has made
so many patches to this package that I don't feel confident that my patches will
apply to the upstream source code.

Comment 1 Jonathan Kamens 2003-06-24 04:14:03 UTC
Created attachment 92576 [details]
fix several memory leaks in pam

Comment 2 Michael Lee Yohe 2003-08-12 14:20:08 UTC
Jonathan - to which version of PAM (I know you specify Rawhide..) did you apply
these patches to?

Comment 3 Jonathan Kamens 2003-08-14 03:58:00 UTC
Not sure.  Probably pam-0.75-49.