[asterisk-dev] [Code Review]: avoid many cppcheck (#2)

junky reviewboard at asterisk.org
Tue Mar 13 22:11:53 CDT 2012



> On March 12, 2012, 10:47 a.m., Mark Michelson wrote:
> > trunk/channels/vcodecs.c, lines 1134-1135
> > <https://reviewboard.asterisk.org/r/1743/diff/6/?file=25845#file25845line1134>
> >
> >     Like with some of the other changes you've made, go ahead and add braces to this one-line if statement.

fixed, with a bunch of braces added to codec_g726.c.


> On March 12, 2012, 10:47 a.m., Mark Michelson wrote:
> > trunk/channels/chan_unistim.c, lines 3158-3161
> > <https://reviewboard.asterisk.org/r/1743/diff/6/?file=25844#file25844line3158>
> >
> >     I don't think you properly addressed the problem that wdoekes raised here. You will still double-fclose the FILE pointer. That is BAD.

when i tried to use wdoekes'solution #2, i was still getting cppcheck warnings (with leaks), so I used wdoekes'solution #1.
Now there's no more cppcheck warnings and fclose() is still done in OpenHistory() when there are errors and in case there's no errors, but count is 0, it will be done in the callers.


> On March 12, 2012, 10:47 a.m., Mark Michelson wrote:
> > trunk/channels/chan_unistim.c, lines 3329-3333
> > <https://reviewboard.asterisk.org/r/1743/diff/6/?file=25844#file25844line3329>
> >
> >     Same here.

see previous message.


> On March 12, 2012, 10:47 a.m., Mark Michelson wrote:
> > trunk/channels/chan_unistim.c, lines 3349-3352
> > <https://reviewboard.asterisk.org/r/1743/diff/6/?file=25844#file25844line3349>
> >
> >     And here, too.

see previous message.


- junky


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1743/#review5795
-----------------------------------------------------------


On March 6, 2012, 9:01 p.m., junky wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1743/
> -----------------------------------------------------------
> 
> (Updated March 6, 2012, 9:01 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch is to prevent many more cppcheck warnings.
> 
> 
> Diffs
> -----
> 
>   trunk/apps/app_minivm.c 357660 
>   trunk/apps/app_osplookup.c 357660 
>   trunk/cdr/cdr_pgsql.c 357660 
>   trunk/cdr/cdr_sqlite3_custom.c 357660 
>   trunk/channels/chan_alsa.c 357660 
>   trunk/channels/chan_dahdi.c 357660 
>   trunk/channels/chan_gtalk.c 357660 
>   trunk/channels/chan_h323.c 357660 
>   trunk/channels/chan_sip.c 357660 
>   trunk/channels/chan_unistim.c 357660 
>   trunk/channels/vcodecs.c 357660 
>   trunk/codecs/codec_dahdi.c 357660 
>   trunk/codecs/codec_g726.c 357660 
>   trunk/codecs/codec_resample.c 357660 
>   trunk/formats/format_h264.c 357660 
>   trunk/funcs/func_callerid.c 357660 
>   trunk/funcs/func_devstate.c 357660 
>   trunk/funcs/func_env.c 357660 
>   trunk/funcs/func_groupcount.c 357660 
>   trunk/funcs/func_odbc.c 357660 
>   trunk/main/ast_expr2.fl 357660 
>   trunk/main/ast_expr2f.c 357660 
>   trunk/main/asterisk.c 357660 
>   trunk/main/data.c 357660 
>   trunk/res/res_config_ldap.c 357660 
>   trunk/res/res_config_sqlite3.c 357660 
>   trunk/res/res_corosync.c 357660 
>   trunk/res/res_format_attr_celt.c 357660 
>   trunk/res/res_format_attr_silk.c 357660 
>   trunk/res/res_http_post.c 357660 
>   trunk/res/res_jabber.c 357660 
>   trunk/res/res_musiconhold.c 357660 
>   trunk/res/res_odbc.c 357660 
>   trunk/res/res_phoneprov.c 357660 
> 
> Diff: https://reviewboard.asterisk.org/r/1743/diff
> 
> 
> Testing
> -------
> 
> used cppcheck 1.52
> it compiles ;)
> 
> 
> Thanks,
> 
> junky
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120314/7d0e865d/attachment-0001.htm>


More information about the asterisk-dev mailing list