Author: tridge Date: 2007-05-22 00:43:10 +0000 (Tue, 22 May 2007) New Revision: 23058
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23058 Log: the cldap code was getting too intimate with the internals of struct asn1_context. A hangover from when it wasn't a allocated structure Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c =================================================================== --- branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2007-05-21 23:35:14 UTC (rev 23057) +++ branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2007-05-22 00:43:10 UTC (rev 23058) @@ -100,7 +100,6 @@ talloc_free(tmp_ctx); return; } - talloc_steal(tmp_ctx, asn1->data); ldap_msg = talloc(tmp_ctx, struct ldap_message); if (ldap_msg == NULL) { @@ -129,8 +128,7 @@ return; } - req->asn1 = asn1; - talloc_steal(req, asn1->data); + req->asn1 = talloc_steal(req, asn1); req->asn1->ofs = 0; req->state = CLDAP_REQUEST_DONE; @@ -312,6 +310,10 @@ req->timeout = io->in.timeout; req->num_retries = io->in.retries; req->is_reply = False; + req->asn1 = asn1_init(req); + if (!req->asn1) { + goto failed; + } req->dest = socket_address_from_strings(req, cldap->sock->backend_name, io->in.dest_address, lp_cldap_port()); @@ -376,6 +378,10 @@ req->cldap = cldap; req->state = CLDAP_REQUEST_SEND; req->is_reply = True; + req->asn1 = asn1_init(req); + if (!req->asn1) { + goto failed; + } req->dest = io->dest; if (talloc_reference(req, io->dest) == NULL) goto failed;