Bug 19978

Summary: Memory leak on a failed connection attempt.
Product: [Retired] Red Hat Linux Reporter: Sam Varshavchik <mrsam>
Component: openldapAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dr, jwm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-04 22:19:33 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:

Description Sam Varshavchik 2000-10-29 06:43:05 UTC
If the LDAP server is down, the failed connection attempt appears to leak
memory.  Example program:


#include <lber.h>
#include <ldap.h>

int main()
{
	LDAP *p;

	for (;;)
	{
		p=ldap_init("127.0.0.1", 389);

		if (!p) break;

		printf("%d\n",
		       ldap_simple_bind_s(p, "dc=example.com",
					  "foobar"));
		printf("unbind=%d\n",
		       ldap_unbind_s(p));
	}
	return (0);
}


If the server is down, this leaks memory rather quickly.  If the server is
up, but binddn/bindpw is wrong, there is no memory leak.  If the server is
up, and binddn and bindpw is right, no memory leak.  Only when there's a
failure to establish a connection

Comment 1 Sam Varshavchik 2001-04-28 22:44:53 UTC
Reconfirmed with openldap 2.0.7

Kicked upstream. http://www.openldap.org/its/index.cgi?findid=1116

Comment 2 John Morrissey 2002-04-21 19:49:37 UTC
This has been fixed upstream in 2.0.19. The RH errata release 2.0.21-1 picks up
this fix.

This bug should be marked as resolved.

Comment 3 Daniel Roesen 2005-06-04 22:19:33 UTC
After three years, doing so now. :-)