added ldap_msgfree() to fix memory leak.

This commit is contained in:
Gunter Knauf 2007-08-15 08:18:37 +00:00
parent 46c92c0b80
commit e5d8693865

View File

@ -126,7 +126,7 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
int rc = 0; int rc = 0;
LDAP *server; LDAP *server;
LDAPURLDesc *ludp = NULL; LDAPURLDesc *ludp = NULL;
LDAPMessage *result; LDAPMessage *result = NULL;
LDAPMessage *entryIterator; LDAPMessage *entryIterator;
int num = 0; int num = 0;
struct SessionHandle *data=conn->data; struct SessionHandle *data=conn->data;
@ -245,6 +245,8 @@ quit:
LDAP_TRACE (("Received %d entries\n", num)); LDAP_TRACE (("Received %d entries\n", num));
if (rc == LDAP_SIZELIMIT_EXCEEDED) if (rc == LDAP_SIZELIMIT_EXCEEDED)
infof(data, "There are more than %d entries\n", num); infof(data, "There are more than %d entries\n", num);
if (result)
ldap_msgfree(result);
if (ludp) if (ludp)
ldap_free_urldesc(ludp); ldap_free_urldesc(ludp);
if (server) if (server)