Bug 97923 - fix several memory leaks in pam
fix several memory leaks in pam
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: pam (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Jay Turner
:
Depends On:
Blocks: CambridgeTarget
  Show dependency treegraph
 
Reported: 2003-06-24 00:13 EDT by Jonathan Kamens
Modified: 2015-01-07 19:05 EST (History)
2 users (show)

See Also:
Fixed In Version: pam-0.77-66
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-16 12:47:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 00:14 EDT, Jonathan Kamens
no flags Details | Diff

  None (edit)
Description Jonathan Kamens 2003-06-24 00:13:22 EDT
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 00:14:03 EDT
Created attachment 92576 [details]
fix several memory leaks in pam
Comment 2 Michael Lee Yohe 2003-08-12 10:20:08 EDT
Jonathan - to which version of PAM (I know you specify Rawhide..) did you apply
these patches to?
Comment 3 Jonathan Kamens 2003-08-13 23:58:00 EDT
Not sure.  Probably pam-0.75-49.

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