Skip to content

encode_assertion_control creates temporary LDAP* struct #86

@tiran

Description

@tiran

The function encode_assertion_control creates a temporary LDAP* struct. This seems pretty wasteful and causes a memory leak #79. We should find a simpler way to encode assertion controls.

static PyObject*
encode_assertion_control(PyObject *self, PyObject *args)
{
int err;
PyObject *res = 0;
char *assertion_filterstr;
struct berval ctrl_val;
LDAP *ld = NULL;
if (!PyArg_ParseTuple(args, "s:encode_assertion_control",
&assertion_filterstr)) {
goto endlbl;
}
err = ldap_create(&ld);
if (err != LDAP_SUCCESS)
return LDAPerror(ld, "ldap_create");
err = ldap_create_assertion_control_value(ld,assertion_filterstr,&ctrl_val);
if (err != LDAP_SUCCESS)
return LDAPerror(ld, "ldap_create_assertion_control_value");
res = LDAPberval_to_object(&ctrl_val);
endlbl:
return res;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy