]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
added ldap_msgfree() to fix memory leak.
authorGunter Knauf <gk@gknw.de>
Wed, 15 Aug 2007 08:18:37 +0000 (08:18 +0000)
committerGunter Knauf <gk@gknw.de>
Wed, 15 Aug 2007 08:18:37 +0000 (08:18 +0000)
lib/ldap.c

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