Hi everyone,
Using ldap_msgfree() needs after ldap_result() , as per man page it is to be used,
is resulting in abort , but using the same after search result is working fine
ldap_init(ldap_host, LDAP_PORT))
ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &desired_version)
id = ldap_simple_bind(ld, root_dn, root_pw)
// ldap_perror(ld, "ldap_set_option");
printf("My ID=%dn",id);
result = ldap_result(ld, id, 1, NULL, &msg);
printf("Ldap_Result=%dn",result);
result = ldap_result2error(ld, msg, 1);
printf("Ldap_Result2error=%dn",result);
ldap_msgfree(msg);
Output:
ldap_bind: Success (0)
My ID=1
Ldap_Result=97
Ldap_Result2error=0
ldap_search_async: io.c:190: ber_free_buf: Assertion `((ber)->ber_opts.lbo_valid==0x2)' failed.
Is there a way to get around while seeing the fucnction implemeted ldap_msgfree() is calling ber_free_element() , which checks BerElement is it valid .in the above program it goes to invalid this causing program to abort , does removing this check causes problem , i'm not aware about the importance of the check.
Thanks
Santosh Kumar
9881481468