asterisk/res
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1922
........

Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
..
ael Resolve FORWARD_NULL static analysis warnings 2012-05-10 20:56:09 +00:00
snmp Convert some strncpys to ast_copy_string 2012-04-19 19:05:17 +00:00
Makefile Merged revisions 318351 via svnmerge from 2011-05-09 23:16:12 +00:00
res_adsi.c Fix broken usage of sizeof() in res_adsi. 2012-03-14 00:29:47 +00:00
res_adsi.exports.in Remove the old stub files, preferring the optional_api method. 2010-07-14 20:48:59 +00:00
res_ael_share.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_ael_share.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_agi.c Fix places in resources where a negative return value could impact execution 2012-04-17 21:14:49 +00:00
res_agi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_calendar.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_calendar.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_calendar_caldav.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_calendar_ews.c Fix checking bounds of array index after using it; improper sizeof 2012-05-17 13:21:19 +00:00
res_calendar_exchange.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_calendar_icalendar.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_clialiases.c Allow each logging destination and console to have its own notion of the verbosity level. 2011-11-29 18:43:16 +00:00
res_clioriginate.c Add missing newlines to CLI logging 2012-04-06 18:19:03 +00:00
res_config_curl.c Make use of va_args more appropriate to form in various res_config modules plus utils. 2012-04-17 21:10:50 +00:00
res_config_ldap.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_config_odbc.c Make use of va_args more appropriate to form in various res_config modules plus utils. 2012-04-17 21:10:50 +00:00
res_config_pgsql.c Make use of va_args more appropriate to form in various res_config modules plus utils. 2012-04-17 21:10:50 +00:00
res_config_sqlite.c Add missing newlines to CLI logging 2012-04-06 18:19:03 +00:00
res_config_sqlite3.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_convert.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_corosync.c res_corosync: Fix build against corosync 2.0. 2012-04-28 01:20:57 +00:00
res_crypto.c Fix incorrect usage of sizeof() in res_crypto. 2012-03-14 00:39:23 +00:00
res_crypto.exports.in Remove built-in AES code and use optional_api instead 2010-07-21 19:11:32 +00:00
res_curl.c Add load priority order, such that preload becomes unnecessary in most cases 2010-07-20 19:35:02 +00:00
res_fax.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
res_fax.exports.in Log spandsp's fax debug output to the FAX logger level. 2010-05-21 15:15:58 +00:00
res_fax_spandsp.c Replace GNU old-style field designator extensions to fix clang warnings 2012-04-04 18:08:28 +00:00
res_format_attr_celt.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_format_attr_silk.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_http_post.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_jabber.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_jabber.exports.in Fix chan_jingle/gtalk load regression introduced in r346087 2011-12-05 14:47:11 +00:00
res_limit.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_monitor.c Resolve FORWARD_NULL static analysis warnings 2012-05-10 20:56:09 +00:00
res_monitor.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_musiconhold.c Fix places in resources where a negative return value could impact execution 2012-04-17 21:14:49 +00:00
res_mutestream.c Convert MuteAudio documentation to XML. 2012-03-19 20:26:51 +00:00
res_odbc.c Resolve FORWARD_NULL static analysis warnings 2012-05-10 20:56:09 +00:00
res_odbc.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_phoneprov.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_pktccops.c Multiple revisions 350788-350789 2012-01-14 15:51:43 +00:00
res_pktccops.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_realtime.c Cleanup references to sipusers and sipfriends dynamic realtime families 2011-11-01 19:53:26 +00:00
res_rtp_asterisk.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_rtp_multicast.c Fix sequence number overflow over 16 bits causing codec change in RTP packets. 2011-10-27 19:48:23 +00:00
res_security_log.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_smdi.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_smdi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_snmp.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_speech.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_speech.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_srtp.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_srtp.exports.in Add SRTP support for Asterisk 2010-06-08 05:29:08 +00:00
res_stun_monitor.c Re-resolve the STUN address if a STUN poll fails for res_stun_monitor. 2011-12-01 21:19:41 +00:00
res_timing_dahdi.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00
res_timing_kqueue.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_timing_pthread.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00
res_timing_timerfd.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00