Frees each message in the result chain pointed to by the res parameter and returns the type of the last message in the chain.
#include <ldap.h> int ldap_msgfree ( LDAPMessage *res);
(IN) Points to the message chain to free. If res is set to NULL, nothing is done.
The ldap_msgfree function is used to free the memory allocated by the ldap_result, ldap_search_s, ldap_search_st, and ldap_search_ext_s functions and returns the type of the last message in the chain.
For a list of possible message types returned by this function, see Section 6.9, Result Message Types.