Bug 1587980 - pam_mysql memory leak
Summary: pam_mysql memory leak
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: pam_mysql
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul P Komkoff Jr
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-06 12:04 UTC by Alexander Bersenev
Modified: 2018-12-14 20:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-10 23:19:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
the patch (242 bytes, patch)
2018-06-06 12:04 UTC, Alexander Bersenev
no flags Details | Diff

Description Alexander Bersenev 2018-06-06 12:04:35 UTC
Created attachment 1448299 [details]
the patch

Description of problem:
There is a known a memory leak in pam_mysql since 2009. The leak happens because mysql_library_end call is missing.

The discussion is available by this link: https://sourceforge.net/p/pam-mysql/bugs/27/

Version-Release number of selected component (if applicable):
0.7RC1

How reproducible:
Always if it works for some time

Steps to Reproduce:
Launch saslauthd configured to use pam_mysql and wait for some time.

Actual results:
Memory leaks

Expected results:
Memory doesn't leak

Comment 1 Nathanael Noblet 2018-07-27 16:21:32 UTC
yeah I can confirm I've known about this bug for years. I didn't know there was a solution however.

There's a discussion here https://sourceforge.net/p/pam-mysql/bugs/27/#c2aa and the patch there as well. I've applied it to a epel7 build and am running it now.
Sorry for the inline patch, but I'm lazy. :)


--- pam_mysql-0.7RC1/pam_mysql.c.org	2018-07-27 10:16:52.781480556 -0600
+++ pam_mysql-0.7RC1/pam_mysql.c	2018-07-27 10:17:23.731647527 -0600
@@ -2338,6 +2338,7 @@
 	}
 
 	mysql_close(ctx->mysql_hdl);
+	mysql_library_end();
 
 	xfree(ctx->mysql_hdl);
 	ctx->mysql_hdl = NULL;

Comment 2 Fedora Update System 2018-12-01 13:18:25 UTC
pam_mysql-0.8.1-0.2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-bb07632c10

Comment 3 Fedora Update System 2018-12-01 13:18:40 UTC
pam_mysql-0.8.1-0.2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e600272170

Comment 4 Fedora Update System 2018-12-02 07:54:29 UTC
pam_mysql-0.8.1-0.2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-bb07632c10

Comment 5 Fedora Update System 2018-12-02 10:10:19 UTC
pam_mysql-0.8.1-0.2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e600272170

Comment 6 Randy Barlow 2018-12-10 23:19:57 UTC
An update associated with this bug has been pushed to stable.

Comment 7 Randy Barlow 2018-12-11 17:04:09 UTC
A Fedora update associated with this bug has been pushed to the stable repository.

Comment 8 Randy Barlow 2018-12-14 20:41:19 UTC
A Fedora update associated with this bug has been pushed to the stable repository.


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