Fixed memory leaking due to not having ber_memfree within the ldap_get_attributes_ber loop. It was wrongly outside of it. Also removed the memory leak that ocurred during search errors. Simply moved allocation of the search result NSArray below where the error is caught. This way, a leak can't be introduced if an error is detected because the NSArray is not yet allocated.
Fixed memory leaking due to not having ber_memfree within the ldap_get_attributes_ber loop. It was wrongly outside of it. Also removed the memory leak that ocurred during search errors. Simply moved allocation of the search result NSArray below where the error is caught. This way, a leak can't be introduced if an error is detected because the NSArray is not yet allocated.

rhussmann/RHLDAPSearch,rhussmann/RHLDAPSearch