[asterisk-dev] some memory leak present in asterisk

Mayank Jain Nawal mayank at in.niksun.com
Wed Mar 25 23:48:43 CDT 2009



There is lot of unused code and memory leak present in the asterisk
code. Below are the details. If you can give me check in permissions
then I can correct these bugs.


[asterisk/apps/app_adsiprog.c:681]: (all) Buffer overrun
[asterisk/apps/app_minivm.c:536]: (style) struct or union member
'leave_vm_options::flags' is never used
[asterisk/apps/app_rpt.c:10412]: (style) Warning - using char variable
in bit operation
[asterisk/apps/app_rpt.c:452]: (style) struct or union member
'rpt_chan_stat::last' is never used
[asterisk/apps/app_rpt.c:453]: (style) struct or union member
'rpt_chan_stat::total' is never used
[asterisk/apps/app_rpt.c:454]: (style) struct or union member
'rpt_chan_stat::count' is never used
[asterisk/apps/app_rpt.c:455]: (style) struct or union member
'rpt_chan_stat::largest' is never used
[asterisk/apps/app_rpt.c:456]: (style) struct or union member
'rpt_chan_stat::largest_time' is never used
[asterisk/apps/app_rpt.c:1960]: (all) Memory leak: str
[asterisk/apps/app_rpt.c:1960]: (error) Memory leak: astr
[asterisk/apps/app_voicemail.c:10052]: (all) Buffer overrun
[asterisk/apps/app_voicemail.c:609]: (style) struct or union member
'vm_state::intro' is never used
[asterisk/apps/app_voicemail.c:4918]: (style) struct or union member
'leave_vm_options::flags' is never used
[asterisk/apps/app_rpt.c:5212]: (all) Memory leak: ident
[asterisk/channels/chan_console.c:840]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/apps/app_rpt.c:2898]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/apps/app_rpt.c:2901]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/apps/app_rpt.c:3649]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/apps/app_rpt.c:3831]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/apps/app_rpt.c:3910]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/channels/chan_dahdi.c:9948]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/channels/chan_dahdi.c:651]: (style) struct or union member
'dahdi_pvt::sub_unused' is never used
[asterisk/channels/chan_dahdi.c:1022]: (style) struct or union member
'dahdi_pvt::confusers' is never used
[asterisk/channels/chan_dahdi.c:11275]: (style) Warning - using char
variable in bit operation
[asterisk/apps/app_rpt.c:10411]: (style) Warning - using char variable
in bit operation
[asterisk/channels/chan_gtalk.c:133]: (style) struct or union member
'gtalk_candidate::receipt' is never used
[asterisk/channels/chan_h323.c:156]: (style) struct or union member
'oh323_pvt::redirip' is never used
[asterisk/channels/chan_h323.c:162]: (style) struct or union member
'oh323_pvt::rdnis' is never used
[asterisk/channels/chan_jingle.c:135]: (style) struct or union member
'jingle_candidate::preference' is never used
[asterisk/channels/chan_mgcp.c:295]: (style) struct or union member
'mgcp_subchannel::iseq' is never used
[asterisk/channels/chan_mgcp.c:336]: (style) struct or union member
'mgcp_endpoint::hascallerid' is never used
[asterisk/channels/chan_mgcp.c:342]: (style) struct or union member
'mgcp_endpoint::group' is never used
[asterisk/channels/chan_mgcp.c:343]: (style) struct or union member
'mgcp_endpoint::iseq' is never used
[asterisk/channels/chan_mgcp.c:344]: (style) struct or union member
'mgcp_endpoint::lastout' is never used
[asterisk/channels/chan_mgcp.c:345]: (style) struct or union member
'mgcp_endpoint::needdestroy' is never used
[asterisk/channels/chan_nbs.c:63]: (style) struct or union member
'nbs_pvt::app' is never used
[asterisk/channels/chan_sip.c:894]: (style) struct or union member
'cfsip_options::supported' is never used
[asterisk/channels/chan_skinny.c:4890]: (error) snprintf size is out of
bounds
[asterisk/channels/chan_skinny.c:5980]: (error) snprintf size is out of
bounds
[asterisk/channels/chan_skinny.c:191]: (style) struct or union member
'register_message::userId' is never used
[asterisk/channels/chan_skinny.c:193]: (style) struct or union member
'register_message::ip' is never used
[asterisk/channels/chan_skinny.c:195]: (style) struct or union member
'register_message::maxStreams' is never used
[asterisk/channels/chan_skinny.c:235]: (style) struct or union member
'station_capabilities::frames' is never used
[asterisk/channels/chan_skinny.c:238]: (style) struct or union member
'station_capabilities::rate' is never used
[asterisk/channels/chan_skinny.c:266]: (style) struct or union member
'alarm_message::alarmSeverity' is never used
[asterisk/channels/chan_skinny.c:268]: (style) struct or union member
'alarm_message::alarmParam1' is never used
[asterisk/channels/chan_skinny.c:269]: (style) struct or union member
'alarm_message::alarmParam2' is never used
[asterisk/channels/chan_skinny.c:306]: (style) struct or union member
'start_tone_message::space' is never used
[asterisk/channels/chan_skinny.c:322]: (style) struct or union member
'set_ringer_message::space' is never used
[asterisk/channels/chan_skinny.c:359]: (style) struct or union member
'start_media_transmission_message::space' is never used
[asterisk/channels/chan_skinny.c:366]: (style) struct or union member
'stop_media_transmission_message::space' is never used
[asterisk/channels/chan_skinny.c:378]: (style) struct or union member
'call_info_message::originalCalledPartyName' is never used
[asterisk/channels/chan_skinny.c:379]: (style) struct or union member
'call_info_message::originalCalledParty' is never used
[asterisk/channels/chan_skinny.c:380]: (style) struct or union member
'call_info_message::lastRedirectingPartyName' is never used
[asterisk/channels/chan_skinny.c:381]: (style) struct or union member
'call_info_message::lastRedirectingParty' is never used
[asterisk/channels/chan_skinny.c:382]: (style) struct or union member
'call_info_message::originalCalledPartyRedirectReason' is never used
[asterisk/channels/chan_skinny.c:383]: (style) struct or union member
'call_info_message::lastRedirectingReason' is never used
[asterisk/channels/chan_skinny.c:384]: (style) struct or union member
'call_info_message::callingPartyVoiceMailbox' is never used
[asterisk/channels/chan_skinny.c:385]: (style) struct or union member
'call_info_message::calledPartyVoiceMailbox' is never used
[asterisk/channels/chan_skinny.c:386]: (style) struct or union member
'call_info_message::originalCalledPartyVoiceMailbox' is never used
[asterisk/channels/chan_skinny.c:387]: (style) struct or union member
'call_info_message::lastRedirectingVoiceMailbox' is never used
[asterisk/channels/chan_skinny.c:388]: (style) struct or union member
'call_info_message::space' is never used
[asterisk/channels/chan_skinny.c:415]: (style) struct or union member
'line_stat_res_message::space' is never used
[asterisk/channels/chan_skinny.c:537]: (style) struct or union member
'open_receive_channel_message::space' is never used
[asterisk/channels/chan_skinny.c:544]: (style) struct or union member
'close_receive_channel_message::space' is never used
[asterisk/channels/chan_skinny.c:550]: (style) struct or union member
'soft_key_template_definition::softKeyLabel' is never used
[asterisk/channels/chan_skinny.c:873]: (style) struct or union member
'call_state_message::space' is never used
[asterisk/channels/chan_skinny.c:882]: (style) struct or union member
'display_prompt_status_message::space' is never used
[asterisk/channels/chan_skinny.c:941]: (style) struct or union member
'skinny_data::setmicrophone' is never used
[asterisk/channels/chan_skinny.c:1202]: (style) struct or union member
'skinny_line_options::curtone' is never used
[asterisk/channels/chan_skinny.c:1202]: (style) struct or union member
'skinny_line_options::hascallerid' is never used
[asterisk/channels/chan_skinny.c:1202]: (style) struct or union member
'skinny_line_options::nonCodecCapability' is never used
[asterisk/channels/chan_skinny.c:1202]: (style) struct or union member
'skinny_line_options::onhooktime' is never used
[asterisk/channels/chan_skinny.c:1202]: (style) struct or union member
'skinny_line_options::msgstate' is never used
[asterisk/channels/chan_unistim.c:349]: (style) struct or union member
'systemtime::w_year' is never used
[asterisk/channels/chan_unistim.c:350]: (style) struct or union member
'systemtime::w_month' is never used
[asterisk/channels/chan_unistim.c:351]: (style) struct or union member
'systemtime::w_day_of_week' is never used
[asterisk/channels/chan_unistim.c:352]: (style) struct or union member
'systemtime::w_day' is never used
[asterisk/channels/chan_unistim.c:353]: (style) struct or union member
'systemtime::w_hour' is never used
[asterisk/channels/chan_unistim.c:354]: (style) struct or union member
'systemtime::w_minute' is never used
[asterisk/channels/chan_unistim.c:355]: (style) struct or union member
'systemtime::w_second' is never used
[asterisk/channels/chan_unistim.c:356]: (style) struct or union member
'systemtime::w_milliseconds' is never used
[asterisk/channels/chan_unistim.c:425]: (style) struct or union member
'unistim_device::phone_current' is never used
[asterisk/channels/xpmr/xpmr.c:160]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/channels/chan_usbradio.c:391]: (style) struct or union member
'sound::desc' is never used
[asterisk/channels/chan_usbradio.c:390]: (style) struct or union member
'sound::ind' is never used
[asterisk/channels/chan_usbradio.c:394]: (style) struct or union member
'sound::samplen' is never used
[asterisk/channels/chan_usbradio.c:395]: (style) struct or union member
'sound::silencelen' is never used
[asterisk/channels/chan_usbradio.c:396]: (style) struct or union member
'sound::repeat' is never used
[asterisk/channels/chan_vpb.cc:271]: (style) struct or union member
'vpb_pvt::f' is never used
[asterisk/channels/console_board.c:53]: (style) struct or union member
'board::kb_output' is never used
[asterisk/channels/console_gui.c:160]: (style) struct or union member
'gui_info::bd_edit' is never used
[asterisk/channels/h323/ast_h323.cxx:1998]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/h323/ast_h323.cxx:2011]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/h323/ast_h323.cxx:2021]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/h323/ast_h323.cxx:2034]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/h323/ast_h323.cxx:2043]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/h323/ast_h323.cxx:1719]: (style) struct or union
member '__codec__::oid' is never used
[asterisk/channels/h323/ast_h323.cxx:571]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/channels/misdn/isdn_lib.c:214]: (style) struct or union member
'misdn_lib::midev_nt' is never used
[asterisk/channels/vcodecs.c:86]: (style) struct or union member
'video_dec_desc::next_seq' is never used
[asterisk/channels/misdn/isdn_lib.c:2258]: (error) Resource leak: rx
[asterisk/channels/misdn/isdn_lib.c:2258]: (error) Resource leak: tx
[asterisk/codecs/codec_adpcm.c:74]: (style) struct or union member
'adpcm_state::zero_count' is never used
[asterisk/codecs/gsm/src/gsm_destroy.c:25]: (style) Redundant condition.
It is safe to deallocate a NULL pointer
[asterisk/formats/format_wav.c:43]: (style) struct or union member
'wav_desc::lasttimeout' is never used
[asterisk/formats/format_wav.c:45]: (style) struct or union member
'wav_desc::last' is never used
[asterisk/main/ast_expr2.c:2317]: (error) Memory leak: vp
[asterisk/main/ast_expr2.c:3439]: (error) Memory leak: vs
[asterisk/main/ast_expr2.c:394]: (style) struct or union member
'expr_node::left' is never used
[asterisk/main/ast_expr2.c:403]: (style) struct or union member
'parse_io::string' is never used
[asterisk/main/ast_expr2.c:405]: (style) struct or union member
'parse_io::scanner' is never used
[asterisk/main/ast_expr2f.c:2335]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/main/ast_expr2f.c:360]: (style) struct or union member
'yy_trans_info::yy_verify' is never used
[asterisk/main/ast_expr2f.c:361]: (style) struct or union member
'yy_trans_info::yy_nxt' is never used
[asterisk/main/ast_expr2f.c:637]: (style) struct or union member
'yyguts_t::yylineno_r' is never used
[asterisk/main/ast_expr2f.c:2334]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/main/asterisk.c:947]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/main/ast_expr2.c:2315]: (error) Memory leak: vp
[asterisk/main/ast_expr2.c:3437]: (error) Memory leak: vs
[asterisk/main/ast_expr2.c:684]: (style) struct or union member
'yyalloc::yyss' is never used
[asterisk/main/ast_expr2.c:685]: (style) struct or union member
'yyalloc::yyvs' is never used
[asterisk/main/ast_expr2.c:686]: (style) struct or union member
'yyalloc::yyls' is never used
[asterisk/main/astobj2.c:344]: (error) Resource leak: refo
[asterisk/main/channel.c:71]: (style) struct or union member
'ast_epoll_data::which' is never used
[asterisk/main/cli.c:238]: (style) Redundant condition. It is safe to
deallocate a NULL pointer
[asterisk/main/dial.c:165]: (style) struct or union member
'ast_option_types::option' is never used
[asterisk/main/dns.c:157]: (style) struct or union member
'dn_answer::ttl' is never used
[asterisk/main/editline/map.c:1401]: (error) Memory leak: p
[asterisk/main/editline/tokenizer.c:121]: (error) Memory leak: tok
[asterisk/main/rtp.c:120]: (style) struct or union member
'ast_rtp::rxoctetcount' is never used
[asterisk/main/rtp.c:151]: (style) struct or union member
'ast_rtp::lastrx' is never used
[asterisk/main/tdd.c:46]: (style) struct or union member
'tdd_state::rawdata' is never used
[asterisk/main/timing.c:44]: (style) struct or union member
'timing_holder::__heap_index' is never used
[asterisk/main/udptl.c:112]: (style) struct or union member
'ast_udptl::resp' is never used
[asterisk/main/udptl.c:115]: (style) struct or union member
'ast_udptl::lasteventseqn' is never used
[asterisk/main/udptl.c:117]: (style) struct or union member
'ast_udptl::flags' is never used
[asterisk/main/udptl.c:149]: (style) struct or union member
'ast_udptl::far' is never used
[asterisk/main/udptl.c:153]: (style) struct or union member
'ast_udptl::rx_expected_seq_no' is never used
[asterisk/menuselect/mxml/mxml-file.c:505]: (error) Memory leak: newbuffer
[asterisk/menuselect/mxml/mxml-string.c:50]: (error) Memory leak: t
[asterisk/pbx/pbx_config.c:517]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/pbx/pbx_config.c:575]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/pbx/pbx_config.c:1208]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/pbx/pbx_dundi.c:465]: (style) struct or union member
'dundi_query_state::chal' is never used
[asterisk/pbx/pbx_dundi.c:466]: (style) struct or union member
'dundi_query_state::challen' is never used
[asterisk/res/ael/ael_lex.c:3139]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/ael_lex.c:3279]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/ael_lex.c:3367]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/ael_lex.c:359]: (style) struct or union member
'yy_trans_info::yy_verify' is never used
[asterisk/res/ael/ael_lex.c:360]: (style) struct or union member
'yy_trans_info::yy_nxt' is never used
[asterisk/res/ael/ael_lex.c:998]: (style) struct or union member
'yyguts_t::yylineno_r' is never used
[asterisk/res/ael/ael.tab.c:458]: (style) struct or union member
'yyalloc::yyss' is never used
[asterisk/res/ael/ael.tab.c:459]: (style) struct or union member
'yyalloc::yyvs' is never used
[asterisk/res/ael/ael.tab.c:460]: (style) struct or union member
'yyalloc::yyls' is never used
[asterisk/res/ael/ael_lex.c:3138]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/ael_lex.c:3278]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/ael_lex.c:3366]: (style) Redundant condition. It is
safe to deallocate a NULL pointer
[asterisk/res/ael/pval.c:4362]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1274]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1276]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1300]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1302]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1461]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1463]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1486]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_config_ldap.c:1488]: (style) Redundant condition. It
is safe to deallocate a NULL pointer
[asterisk/res/res_limit.c:45]: (style) struct or union member
'limits::limit' is never used
[asterisk/res/res_phoneprov.c:89]: (style) struct or union member
'pp_variable_lookup::id' is never used
[asterisk/tests/test_heap.c:37]: (style) struct or union member
'node::index' is never used
[asterisk/utils/ael_main.c:302]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/utils/astman.c:549]: (all) Buffer overrun
[asterisk/utils/conf2ael.c:486]: (all) Memory leak: all
[asterisk/utils/conf2ael.c:160]: (style) struct or union member
'ast_include::rname' is never used
[asterisk/utils/conf2ael.c:161]: (style) struct or union member
'ast_include::registrar' is never used
[asterisk/utils/conf2ael.c:165]: (style) struct or union member
'ast_include::stuff' is never used
[asterisk/utils/conf2ael.c:181]: (style) struct or union member
'ast_ignorepat::registrar' is never used
[asterisk/utils/conf2ael.c:212]: (style) struct or union member
'ast_state_cb::id' is never used
[asterisk/utils/conf2ael.c:214]: (style) struct or union member
'ast_state_cb::callback' is never used
[asterisk/utils/conf2ael.c:243]: (style) struct or union member
'cfextension_states::extension_state' is never used
[asterisk/utils/conf2ael.c:276]: (style) struct or union member
'profile_entry::scale' is never used
[asterisk/utils/conf2ael.c:277]: (style) struct or union member
'profile_entry::mark' is never used
[asterisk/utils/conf2ael.c:278]: (style) struct or union member
'profile_entry::value' is never used
[asterisk/utils/conf2ael.c:279]: (style) struct or union member
'profile_entry::events' is never used
[asterisk/utils/conf2ael.c:283]: (style) struct or union member
'profile_data::entries' is never used
[asterisk/utils/conf2ael.c:284]: (style) struct or union member
'profile_data::max_size' is never used
[asterisk/utils/conf2ael.c:285]: (style) struct or union member
'profile_data::e' is never used
[asterisk/utils/extconf.c:3223]: (all) Buffer overrun
[asterisk/utils/extconf.c:2996]: (style) Redundant condition. It is safe
to deallocate a NULL pointer
[asterisk/utils/extconf.c:69]: (style) struct or union member
'ast_channel::x' is never used
[asterisk/utils/extconf.c:1413]: (style) struct or union member
'ast_config_engine::realtime_func' is never used
[asterisk/utils/extconf.c:1414]: (style) struct or union member
'ast_config_engine::realtime_multi_func' is never used
[asterisk/utils/extconf.c:1415]: (style) struct or union member
'ast_config_engine::update_func' is never used
[asterisk/utils/extconf.c:2905]: (style) struct or union member
'ast_state_cb::id' is never used
[asterisk/utils/extconf.c:2907]: (style) struct or union member
'ast_state_cb::callback' is never used
[asterisk/utils/extconf.c:2925]: (style) struct or union member
'store_hint::context' is never used
[asterisk/utils/extconf.c:2928]: (style) struct or union member
'store_hint::laststate' is never used
[asterisk/utils/extconf.c:2936]: (style) struct or union member
'cfextension_states::extension_state' is never used

Some more to go ..

Regards
Mayank Jain





More information about the asterisk-dev mailing list