Fix potential bridge hook resource leak if the hook install fails.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-06-20 17:21:40 +00:00
parent 33eb15a242
commit cd40e179a9
5 changed files with 61 additions and 11 deletions

View File

@@ -2161,8 +2161,10 @@ int conf_set_menu_to_user(const char *menu_name, struct confbridge_user *user)
ao2_ref(menu, +1);
pvt->menu = menu;
ast_bridge_dtmf_hook(&user->features, pvt->menu_entry.dtmf, menu_hook_callback,
pvt, menu_hook_destroy, 0);
if (ast_bridge_dtmf_hook(&user->features, pvt->menu_entry.dtmf,
menu_hook_callback, pvt, menu_hook_destroy, 0)) {
menu_hook_destroy(pvt);
}
}
ao2_unlock(menu);