Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_dup_control()

Makes an allocated copy of an LDAPControl.

Syntax

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

Parameters

This function takes the following parameter:

ctrl

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

Returns

This function returns a pointer to an allocated LDAPControl structure if successful, or NULL if an error occurs.

Description

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.

Memory Concerns

The structure that is returned should be freed by calling ldap_control_free(3LDAP) , an LDAP API function.

See Also

ldap_control_free(3LDAP)