Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_msgfree()

The ldap_msgfree() function frees the memory allocated for a result by ldap_result() or ldap_search_s(). For more information, see "Freeing the Results of a Search" on page 139.

Syntax

#include <ldap.h>
int ldap_msgfree( LDAPMessage *lm );

Parameters

This function has the following parameters:

lm

ID of the result to be freed from memory.

Returns

One of the following values:

Example

The following example frees the results of a search.

#include <stdio.h>
#include <ldap.h>
...
LDAP *ld;
LDAPMessage *result;
char *my_searchbase = "o=Airius.com";
char *my_filter = "(sn=Jensen)";
char *get_attr[] = { "cn", "mail", NULL };
...
/* Search the directory */
if ( ldap_search_s( ld, my_searchbase, LDAP_SCOPE_SUBTREE, my_filter, get_attr, 0, &result ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "ldap_search_s" );
   return( 1 );
}
...
/* Free the results when done */
ldap_msgfree( result );
...

See Also

ldap_result(), ldap_search_s().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23