Audit ast_sockaddr_resolve() usage for memory leaks.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 17 Mar 2015 21:52:47 +0000 (21:52 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 17 Mar 2015 21:52:47 +0000 (21:52 +0000)
commitc41dd32b94d46812241785697b997628641e2865
tree317a564d837b6a6a59eca76d2d335158ef09f959
parent803a916334363adcaf5b88bf16eb99d4c1d90dae
Audit ast_sockaddr_resolve() usage for memory leaks.

Valgrind found some memory leaks associated with ast_sockaddr_resolve().
Most of the leaks had already been fixed by earlier memory leak hunt
patches.  This patch performs an audit of ast_sockaddr_resolve() and found
one more.

* Fix ast_sockaddr_resolve() memory leak in
apps/app_externalivr.c:app_exec().

* Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
parameter for safety so the pointer will never be uninitialized on return.
The same goes for res/res_pjsip_acl.c:extract_contact_addr().

* Made functions that call ast_sockaddr_resolve() with RAII_VAR()
controlling the addrs variable use ast_free instead of ast_free_ptr to
provide better MALLOC_DEBUG information.

Review: https://reviewboard.asterisk.org/r/4509/
........

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

Merged revisions 433057 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_externalivr.c
main/netsock2.c
res/res_pjsip_acl.c
res/res_pjsip_sdp_rtp.c
res/res_pjsip_t38.c