summaryrefslogtreecommitdiff
path: root/channels/chan_motif.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-06-25 01:12:58 +0000
committerMatthew Jordan <mjordan@digium.com>2013-06-25 01:12:58 +0000
commit13b470d704285b596caab33039fdf1b063bbcf9d (patch)
tree74dae44213d76a78b1ae30da11bb43e92e9f8ead /channels/chan_motif.c
parent91217ac3c1fd73efe13407a013260ac7cf937b7b (diff)
Fix memory/ref counting leaks in a variety of locations
This patch fixes the following memory leaks: * http.c: The structure containing the addresses to bind to was not being deallocated when no longer used * named_acl.c: The global configuration information was not disposed of * config_options.c: An invalid read was occurring for certain option types. * res_calendar.c: The loaded calendars on module unload were not being properly disposed of. * chan_motif.c: The format capabilities needed to be disposed of on module unload. In addition, this now specifies the default options for the maxpayloads and maxicecandidates in such a way that it doesn't cause the invalid read in config_options.c to occur. (issue ASTERISK-21906) Reported by: John Hardin patches: http.patch uploaded by jhardin (license 6512) named_acl.patch uploaded by jhardin (license 6512) config_options.patch uploaded by jhardin (license 6512) res_calendar.patch uploaded by jhardin (license 6512) chan_motif.patch uploaded by jhardin (license 6512) ........ Merged revisions 392810 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_motif.c')
-rw-r--r--channels/chan_motif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_motif.c b/channels/chan_motif.c
index a3b851213..22b5eaec8 100644
--- a/channels/chan_motif.c
+++ b/channels/chan_motif.c
@@ -2711,9 +2711,9 @@ static int load_module(void)
aco_option_register_custom(&cfg_info, "connection", ACO_EXACT, endpoint_options, NULL, custom_connection_handler, 0);
aco_option_register_custom(&cfg_info, "transport", ACO_EXACT, endpoint_options, NULL, custom_transport_handler, 0);
aco_option_register(&cfg_info, "maxicecandidates", ACO_EXACT, endpoint_options, DEFAULT_MAX_ICE_CANDIDATES, OPT_UINT_T, PARSE_DEFAULT,
- FLDSET(struct jingle_endpoint, maxicecandidates));
+ FLDSET(struct jingle_endpoint, maxicecandidates), DEFAULT_MAX_ICE_CANDIDATES);
aco_option_register(&cfg_info, "maxpayloads", ACO_EXACT, endpoint_options, DEFAULT_MAX_PAYLOADS, OPT_UINT_T, PARSE_DEFAULT,
- FLDSET(struct jingle_endpoint, maxpayloads));
+ FLDSET(struct jingle_endpoint, maxpayloads), DEFAULT_MAX_PAYLOADS);
ast_format_cap_add_all_by_type(jingle_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
@@ -2764,6 +2764,8 @@ static int reload(void)
static int unload_module(void)
{
ast_channel_unregister(&jingle_tech);
+ ast_format_cap_destroy(jingle_tech.capabilities);
+ jingle_tech.capabilities = NULL;
ast_rtp_glue_unregister(&jingle_rtp_glue);
ast_sched_context_destroy(sched);
aco_info_destroy(&cfg_info);