mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user