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 - fix several memory leaks in pam
Summary: fix several memory leaks in pam
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: pam
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: CambridgeTarget
TreeView+ depends on / blocked
 
Reported: 2003-06-24 04:13 UTC by Jonathan Kamens
Modified: 2015-01-08 00:05 UTC (History)
2 users (show)

Fixed In Version: pam-0.77-66
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-16 17:47:17 UTC
Embargoed:


Attachments (Terms of Use)
fix several memory leaks in pam (deleted)
2003-06-24 04:14 UTC, Jonathan Kamens
no flags Details | Diff

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.



Note You need to log in before you can comment on or make changes to this bug.