summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-03-17 21:49:30 +0000
committerRichard Mudgett <rmudgett@digium.com>2015-03-17 21:49:30 +0000
commit2122c205e677a0da93b582b148b6495b660e1e6d (patch)
tree7c8b7db988c167cc9b15006a010be15b64211082 /res/res_pjsip_t38.c
parent94fe4a91781e8f21936cb382c8ecedf1bead44c1 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index d91d370d6..029867137 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -619,7 +619,7 @@ static int negotiate_incoming_sdp_stream(struct ast_sip_session *session, struct
{
struct t38_state *state;
char host[NI_MAXHOST];
- RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free_ptr);
+ RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free);
if (!session->endpoint->media.t38.enabled) {
return -1;
@@ -762,7 +762,7 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct a
const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_media *local_stream,
const struct pjmedia_sdp_session *remote, const struct pjmedia_sdp_media *remote_stream)
{
- RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free_ptr);
+ RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free);
char host[NI_MAXHOST];
struct t38_state *state;