r7716: a single wrapped ldap blob can contain multiple ldap messages
authorAndrew Tridgell <tridge@samba.org>
Sat, 18 Jun 2005 09:08:08 +0000 (09:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:25 +0000 (13:18 -0500)
(This used to be commit de5f265b6c586335965a6de844c203206261cc3b)

source4/libcli/ldap/ldap_client.c

index e392002a19a45a80f69c5cf5da8bf3fc8decc390..bc70cd56aa3bf83d3045cfeee31f5a102a69c060 100644 (file)
@@ -213,12 +213,12 @@ static void ldap_try_decode_wrapped(struct ldap_connection *conn)
                        return;
                }
 
-               if (ldap_decode(&asn1, msg)) {
+               while (ldap_decode(&asn1, msg)) {
                        ldap_match_message(conn, msg);
-               } else {
-                       talloc_free(msg);
+                       msg = talloc(conn, struct ldap_message);
                }
                
+               talloc_free(msg);
                asn1_free(&asn1);
 
                if (conn->partial.length == len + 4) {