Use LDAP memory management functions instead of Asterisk's
authorMatthew Jordan <mjordan@digium.com>
Wed, 10 Apr 2013 14:26:22 +0000 (14:26 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 10 Apr 2013 14:26:22 +0000 (14:26 +0000)
commit1f3fff7b91c7ca821e30267ab13db7341d89f122
tree412f43a3c6082b837b81b1c33176bef6bcbf1286
parentcaf4a5f6057c082c195835bc5ae61f75ca9c940e
Use LDAP memory management functions instead of Asterisk's

When MALLOC_DEBUG is enabled with res_config_ldap, issues (munmap_chunk:
invalid pointer errors) can occur as the memory is being allocated with
Asterisk's wrappers around malloc/calloc/free/strdup, as opposed to the
LDAP library's wrappers.

This patch uses the LDAP library's wrappers where appropriate, so that
compiling with MALLOC_DEBUG doesn't cause more problems than it solves.

Note that the patch listed below was modified slightly for this commit
to account for some additional memory allocation/deallocations.

(closes issue ASTERISK-17386)
Reported by: John Covert
Tested by: Andrew Latham
patches:
  issue18789-1.8-r316873.patch uploaded by seanbright (License 5060)
........

Merged revisions 385190 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 385199 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_config_ldap.c