21.6. slapi_dup_control()

Description

Makes an allocated copy of an LDAPControl. This function duplicates the contents of an LDAPControl structure. All fields within the LDAPControl are copied to a new, allocated structure, and a pointer to the new structure is returned.

Syntax

#include "slapi-plugin.h"
LDAPControl * slapi_dup_control( LDAPControl *ctrl )

Parameters

This function takes the following parameter:

ctrl
Pointer to an LDAPControl structure whose contents are to be duplicated.
Returns

This function returns one of the following values:

  • A pointer to an allocated LDAPControl structure if successful.
  • NULL if an error occurs.
Memory Concerns

The structure that is returned should be freed by calling ldap_control_free(), which is an LDAP API function; see the Mozilla LDAP SDK for C Programmer's Guide.

See Also

ldap_control_free()