Summary:ASTERISK-06045: [patch] wrong return from build_peer()
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2006-01-11 08:47:48.000-0600Date Closed:2008-01-15 16:14:23.000-0600
Versions:Frequency of
Description:the following sequence in chan_sip.c::build_peer() near line
12069 has a 'return -1' whereas it should be 'return NULL'

       } else {
               if (!(peer = ast_calloc(1, sizeof(*peer))))
-                        return -1;
+                        return NULL;
               if (realtime)


caught by compiling with -Werror.

I think you should really enforce stricter compilation flags, it
makes life way easier in catching this kind of errors.

I always build with -Werror -Wunused, and have patches for that
if someone is interested (there are a few pieces like gsm which
do not compile with -Werror but that is selectively disabled, and in
any case that code is never modified).
Comments:By: Russell Bryant (russell) 2006-01-11 12:23:58.000-0600

fixed in the trunk, sorry about that!

oej:  why did you assign this to yourself instead of just fixing it?

By: Russell Bryant (russell) 2006-01-11 12:25:05.000-0600

rizzo:  You'll have to talk to Kevin about changing CFLAGS.  I don't think I have the authority to make a call on that.  Thanks for your help once again!

By: Digium Subversion (svnbot) 2008-01-15 16:14:23.000-0600

Repository: asterisk
Revision: 7988

U   trunk/channels/chan_sip.c

r7988 | russell | 2008-01-15 16:14:22 -0600 (Tue, 15 Jan 2008) | 2 lines

fix incorrect return value (issue ASTERISK-6045)