From: Volker Lendecke Date: Mon, 10 Aug 2020 12:47:26 +0000 (+0200) Subject: ldap_server: Avoid talloc_memdup() for ldap_decode() X-Git-Tag: talloc-2.3.2~867 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86ab46766768dd3fee40f6c61431395fb099fb73;p=thirdparty%2Fsamba.git ldap_server: Avoid talloc_memdup() for ldap_decode() 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 Reviewed-by: Andreas Schneider --- diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index ee82a30912f..07db1de1b16 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -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);