]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldap_server: Avoid talloc_memdup() for ldap_decode()
authorVolker Lendecke <vl@samba.org>
Mon, 10 Aug 2020 12:47:26 +0000 (14:47 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 17 Aug 2020 09:46:36 +0000 (09:46 +0000)
Slight optimization for the ldap server: We don't need to copy the
client PDU into the ASN1 struct, the decoding process happens
immediately in the same routine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/ldap_server/ldap_server.c

index ee82a30912f0fdc157afe2e0430548a8c1ac7e16..07db1de1b16530cf80d7b30b1af52844ad0a8307 100644 (file)
@@ -589,10 +589,7 @@ static void ldapsrv_call_read_done(struct tevent_req *subreq)
                return;
        }
 
-       if (!asn1_load(asn1, blob)) {
-               ldapsrv_terminate_connection(conn, "asn1_load failed");
-               return;
-       }
+       asn1_load_nocopy(asn1, blob.data, blob.length);
 
        limits.max_search_size =
                lpcfg_ldap_max_search_request_size(conn->lp_ctx);