diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-01-30 16:49:59 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2015-01-30 16:49:59 +0000 |
commit | bd0bdf1e41c52afb6dbf262d60a8ed02d2110fcd (patch) | |
tree | 8f6b06aedf21985ef4c0b3ca1b21ea7e56319bfa /res/res_pjsip_refer.c | |
parent | 388d691f34d7cfcb77130965bf8709eee4b692c1 (diff) |
Fix some memory leaks.
These memory leaks were found and fixed by John Hardin. I'm just
committing them for him.
ASTERISK-24736 #close
Reported by Mark Michelson
Review: https://reviewboard.asterisk.org/r/4389
........
Merged revisions 431468 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_refer.c')
-rw-r--r-- | res/res_pjsip_refer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c index 87700ac27..cc0616e9d 100644 --- a/res/res_pjsip_refer.c +++ b/res/res_pjsip_refer.c @@ -242,16 +242,16 @@ static struct ast_frame *refer_progress_framehook(struct ast_channel *chan, stru /* If a notification is due to be sent push it to the thread pool */ if (notification) { - if (ast_sip_push_task(progress->serializer, refer_progress_notify, notification)) { - ao2_cleanup(notification); - } - /* If the subscription is being terminated we don't need the frame hook any longer */ if (notification->state == PJSIP_EVSUB_STATE_TERMINATED) { ast_debug(3, "Detaching REFER progress monitoring hook from '%s' as subscription is being terminated\n", ast_channel_name(chan)); ast_framehook_detach(chan, progress->framehook); } + + if (ast_sip_push_task(progress->serializer, refer_progress_notify, notification)) { + ao2_cleanup(notification); + } } return f; @@ -420,6 +420,7 @@ static void refer_attended_destroy(void *obj) ao2_cleanup(attended->transferer); ast_channel_unref(attended->transferer_chan); ao2_cleanup(attended->transferer_second); + ao2_cleanup(attended->progress); } /*! \brief Allocator for attended transfer task */ |