[asterisk-dev] [Code Review] Eliminate double close of file descriptor in manager.c

Mark Michelson reviewboard at asterisk.org
Mon Mar 5 12:31:31 CST 2012


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

Ship it!


Seems like the proper approach.

- Mark


On March 5, 2012, 12:01 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1793/
> -----------------------------------------------------------
> 
> (Updated March 5, 2012, 12:01 p.m.)
> 
> 
> Review request for Asterisk Developers, Mark Michelson and Matt Jordan.
> 
> 
> Summary
> -------
> 
> Another one of those attempts to fclose something followed by using close on its file descriptor cropped up in manager.c
> 
> This just applies the same method of checking if the file is NULL before attempting fclose, checking output for close/fclose, etc. that was used with the file descriptor issue in tcptls that I used in ast_tcptls_close_session_file.  There was only one observable instance of this behavior that I noticed in manager.c, so I didn't make a new function for it.
> 
> 
> This addresses bug ASTERISK-18453.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18453
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/manager.c 358161 
> 
> Diff: https://reviewboard.asterisk.org/r/1793/diff
> 
> 
> Testing
> -------
> 
> I couldn't effectively test much here.  Like with the last file descriptor double close issue, I could not reproduce the bug on my test machines. This was the suggested approach then though, and this is a very similar situation.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120305/b183030c/attachment.htm>


More information about the asterisk-dev mailing list