[Home]

Summary:ASTERISK-03860: Dead code in chan_iax2.c
Reporter:mikma (mikma)Labels:
Date Opened:2005-04-04 15:51:15Date Closed:2008-01-15 15:30:34.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The second branch of the following if-statement in load_module in chan_iax2.c is unreachable.

int res = 0;
...
if (!res) {
               res = start_network_thread();
               if (option_verbose > 1)
                       ast_verbose(VERBOSE_PREFIX_2 "IAX Ready and Listening on %s port %d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
       } else {
               ast_log(LOG_ERROR, "Unable to start network thread\n");
               ast_netsock_release(&netsock);
       }
Comments:By: Clod Patry (junky) 2005-04-04 16:07:51

Please attach your code as a diff -u format.
Also, please read the bug guidelines.
Thanks.

By: mikma (mikma) 2005-04-04 16:38:32

I'm sorry I wasn't more detailed in my report. But I don't have any patch, since I don't know how it should be fixed. Maybe ast_netsock_release(&netsock) should be called if start_network_thread fails?

By: Kevin P. Fleming (kpfleming) 2005-04-04 18:39:26

Fixed in CVS, thanks!

By: Russell Bryant (russell) 2005-04-05 01:04:19

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:30:29.000-0600

Repository: asterisk
Revision: 5386

U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r5386 | kpfleming | 2008-01-15 15:30:28 -0600 (Tue, 15 Jan 2008) | 2 lines

move start_network_thread to _before_ testing its result :-) (bug ASTERISK-3860)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5386

By: Digium Subversion (svnbot) 2008-01-15 15:30:34.000-0600

Repository: asterisk
Revision: 5392

U   branches/v1-0/channels/chan_iax2.c

------------------------------------------------------------------------
r5392 | russell | 2008-01-15 15:30:34 -0600 (Tue, 15 Jan 2008) | 2 lines

check for result *after* starting the network thread (bug ASTERISK-3860)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5392