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.
#include <ldap.h>
int ldap_msgfree( LDAPMessage *lm );
lm |
LDAP_SUCCESS. #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 );
...
ldap_result(), ldap_search_s().
Last Updated: 10/01/98 17:06:23