Bug 97923 - fix several memory leaks in pam
Summary: fix several memory leaks in pam
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: pam   
(Show other bugs)
Version: 1.0
Hardware: All Linux
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Jay Turner
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:
Story Points: ---
Clone Of:
Last Closed: 2004-11-16 17:47:17 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix several memory leaks in pam (2.93 KB, patch)
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.