From 4d89a50544324fdac0f08497dc142c171bfcd97d Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 14 Dec 2015 15:15:52 +0100 Subject: [PATCH] tm: avoiding conditional directives that split up parts of statements - patch by Romero Malaquias, FS#434 --- modules/tm/t_fwd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c index 9cd002f891a..15f0969af1c 100644 --- a/modules/tm/t_fwd.c +++ b/modules/tm/t_fwd.c @@ -146,6 +146,7 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req, str ua_bak; int free_ua; int backup_route_type; + int test_dst; snd_flags_t fwd_snd_flags_bak; snd_flags_t rpl_snd_flags_bak; struct socket_info *force_send_socket_bak; @@ -427,14 +428,14 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req, if (likely(next_hop!=0 || (flags & UAC_DNS_FAILOVER_F))){ /* next_hop present => use it for dns resolution */ #ifdef USE_DNS_FAILOVER - if (uri2dst2(&t->uac[branch].dns_h, dst, fsocket, snd_flags, - next_hop?next_hop:uri, fproto) == 0) + test_dst = (uri2dst2(&t->uac[branch].dns_h, dst, fsocket, snd_flags, + next_hop?next_hop:uri, fproto) == 0); #else /* dst filled from the uri & request (send_socket) */ - if (uri2dst2(dst, fsocket, snd_flags, - next_hop?next_hop:uri, fproto)==0) + test_dst = (uri2dst2(dst, fsocket, snd_flags, + next_hop?next_hop:uri, fproto)==0); #endif - { + if (test_dst){ ret=E_BAD_ADDRESS; goto error01; }