kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
October 2014
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
34 participants
381 discussions
Start a n
N
ew thread
git:master: timer_funcs.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 2c9d2bf4d6505d6c71fae4d994216944a2f475e1 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2c9d2bf…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 14:45:42 2014 -0400 timer_funcs.h: logging: convert LOG to LM_* --- timer_funcs.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/timer_funcs.h b/timer_funcs.h index bd514c1..0a065a2 100644 --- a/timer_funcs.h +++ b/timer_funcs.h @@ -116,7 +116,7 @@ static inline int _timer_dist_tl(struct timer_ln* tl, ticks_t delta) { if (delta<H0_ENTRIES){ if (delta==0){ - LOG(L_WARN, "WARNING: timer: add_timeout: 0 expire timer added\n"); + LM_WARN("0 expire timer added\n"); _timer_add_list(&timer_lst->expired, tl); }else{ _timer_add_list( &timer_lst->h0[tl->expire & H0_MASK], tl);
10 years, 3 months
1
0
0
0
git:master: char_msg_val.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: b75ecbceba4e585b761c20271c6d319b5cbde9e2 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b75ecbc…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 14:43:39 2014 -0400 char_msg_val.h: logging: convert LOG to LM_* --- char_msg_val.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/char_msg_val.h b/char_msg_val.h index e78bd9d..c265bd1 100644 --- a/char_msg_val.h +++ b/char_msg_val.h @@ -57,7 +57,7 @@ inline static int char_msg_val( struct sip_msg *msg, char *cv ) str src[8]; if (unlikely(!check_transaction_quadruple(msg))) { - LOG(L_ERR, "ERROR: can't calculate char_value due " + LM_ERR("can't calculate char_value due " "to a parsing error\n"); memset( cv, '0', MD5_LEN ); return 0; @@ -81,7 +81,7 @@ inline static int char_msg_val( struct sip_msg *msg, char *cv ) if (msg->from->parsed==0){ /* parse from body */ if (unlikely(parse_from_header(msg) == -1)){ - LOG(L_ERR, "error while parsing From header\n"); + LM_ERR("error while parsing From header\n"); return 0; } }
10 years, 3 months
1
0
0
0
git:master: fix_lumps.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: d0ed596cd420d9a16a339d64c572c8c72bac1017 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d0ed596…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 14:43:15 2014 -0400 fix_lumps.h: logging: convert LOG to LM_* --- fix_lumps.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fix_lumps.h b/fix_lumps.h index dcec6c8..b21cf46 100644 --- a/fix_lumps.h +++ b/fix_lumps.h @@ -65,7 +65,7 @@ inline static void free_via_clen_lump( struct lump **list ) next=lump->next; if (lump->type==HDR_VIA_T||lump->type==HDR_CONTENTLENGTH_T) { if (lump->flags & (LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){ - LOG(L_CRIT, "BUG: free_via_clen_lmp: lump %p, flags %x\n", + LM_CRIT("free_via_clen_lmp: lump %p, flags %x\n", lump, lump->flags); /* ty to continue */ }
10 years, 3 months
1
0
0
0
git:master: ut.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: eaf74185d78bb9d3edea50c84dbebb32571c2fb2 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eaf7418…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 14:28:48 2014 -0400 ut.h: logging: convert LOG to LM_* --- ut.h | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ut.h b/ut.h index aa7f33c..3c4a614 100644 --- a/ut.h +++ b/ut.h @@ -316,7 +316,7 @@ static inline char* int2strbuf(unsigned long l, char *r, int r_size, int* len) l/=10; }while(l && (i>=0)); if (l && (i<0)){ - LOG(L_CRIT, "BUG: int2str: overflow\n"); + LM_CRIT("overflow\n"); } if (len) *len=(INT2STR_MAX_LEN-2)-i; return &r[i+1]; @@ -558,7 +558,7 @@ inline static int hex2int(char hex_digit) if (hex_digit>='A' && hex_digit<='F') return hex_digit-'A'+10; /* no valid hex digit ... */ - LOG(L_ERR, "ERROR: hex2int: '%c' is no hex char\n", hex_digit ); + LM_ERR("'%c' is no hex char\n", hex_digit ); return -1; } @@ -581,7 +581,7 @@ inline static int un_escape(str *user, str *new_user ) int hi, lo; if( new_user==0 || new_user->s==0) { - LOG(L_CRIT, "BUG: un_escape: called with invalid param\n"); + LM_CRIT("invalid param\n"); return -1; } @@ -591,28 +591,27 @@ inline static int un_escape(str *user, str *new_user ) for (i = 0; i < user->len; i++) { if (user->s[i] == '%') { if (i + 2 >= user->len) { - LOG(L_ERR, "ERROR: un_escape: escape sequence too short in" - " '%.*s' @ %d\n", + LM_ERR("escape sequence too short in '%.*s' @ %d\n", user->len, user->s, i ); goto error; } hi=hex2int(user->s[i + 1]); if (hi<0) { - LOG(L_ERR, "ERROR: un_escape: non-hex high digit in an escape sequence in" + LM_ERR("non-hex high digit in an escape sequence in" " '%.*s' @ %d\n", user->len, user->s, i+1 ); goto error; } lo=hex2int(user->s[i + 2]); if (lo<0) { - LOG(L_ERR, "ERROR: non-hex low digit in an escape sequence in " + LM_ERR("non-hex low digit in an escape sequence in " "'%.*s' @ %d\n", user->len, user->s, i+2 ); goto error; } value=(hi<<4)+lo; if (value < 32 || value > 126) { - LOG(L_ERR, "ERROR: non-ASCII escaped character in '%.*s' @ %d\n", + LM_ERR("non-ASCII escaped character in '%.*s' @ %d\n", user->len, user->s, i ); goto error; }
10 years, 3 months
1
0
0
0
git:master: action.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: bb71813843d6c3d1cd074308851b3af0387d68d3 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bb71813…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 14:19:36 2014 -0400 action.c: logging: convert LOG to LM_* --- action.c | 98 +++++++++++++++++++++++-------------------------------------- 1 files changed, 37 insertions(+), 61 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=bb7…
10 years, 3 months
1
0
0
0
git:4.0: rr: Fix memory leak when using outbound
by Hugh Waite
Module: sip-router Branch: 4.0 Commit: 22c368f6db339540a93823650e8bb6e450d73d77 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=22c368f…
Author: Hugh Waite <hugh.waite(a)acision.com> Committer: Hugh Waite <hugh.waite(a)acision.com> Date: Thu Oct 2 18:37:00 2014 +0100 rr: Fix memory leak when using outbound - Flow token memory is freed after building the rr header --- modules/rr/record.c | 82 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 58 insertions(+), 24 deletions(-) diff --git a/modules/rr/record.c b/modules/rr/record.c index 41a3245..a6f75c4 100644 --- a/modules/rr/record.c +++ b/modules/rr/record.c @@ -375,11 +375,12 @@ static int copy_flow_token(str *token, struct sip_msg *_m) int record_route(struct sip_msg* _m, str *params) { struct lump* l, *l2; - str user; + str user = {NULL, 0}; struct to_body* from = NULL; str* tag; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; @@ -406,7 +407,8 @@ int record_route(struct sip_msg* _m, str *params) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; tag = &from->tag_value; @@ -426,17 +428,20 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -5; + ret = -5; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_REALMS, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_REALMS, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -6; + ret = -6; + goto error; } if (build_rr(l, l2, &user, tag, params, OUTBOUND, 0, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } } @@ -444,18 +449,25 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } if (build_rr(l, l2, &user, tag, params, use_ob ? OUTBOUND : INBOUND, use_ob, sips) < 0) { LM_ERR("failed to insert inbound Record-Route\n"); - return -4; + ret = -4; + goto error; } /* reset the rr_param buffer */ rr_param_buf.len = 0; - return 0; + ret = 0; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } @@ -471,7 +483,7 @@ int record_route(struct sip_msg* _m, str *params) */ int record_route_preset(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; struct to_body* from; struct lump* l; char* hdr, *p; @@ -480,6 +492,7 @@ int record_route_preset(struct sip_msg* _m, str* _data) char *rr_prefix; int rr_prefix_len; int sips; + int ret = 0; sips = rr_is_sips(_m); if(sips==0) { @@ -514,7 +527,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; } @@ -522,7 +536,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T); if (!l) { LM_ERR("failed to create lump anchor\n"); - return -3; + ret = -3; + goto error; } hdr_len = rr_prefix_len; @@ -545,7 +560,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) hdr = pkg_malloc(hdr_len); if (!hdr) { LM_ERR("no pkg memory left\n"); - return -4; + ret = -4; + goto error; } p = hdr; @@ -582,9 +598,15 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (!insert_new_lump_after(l, hdr, hdr_len, 0)) { LM_ERR("failed to insert new lump\n"); pkg_free(hdr); - return -5; + ret = -5; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } /*! @@ -723,12 +745,13 @@ lump_err: int record_route_advertised_address(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; str *tag = NULL; struct lump* l; struct lump* l2; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; user.s = 0; @@ -753,7 +776,8 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } tag = &((struct to_body*)_m->from->parsed)->tag_value; } @@ -765,18 +789,21 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_PROTO, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_PROTO, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -4; + ret = -4; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, OUTBOUND, 0, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -5; + ret = -5; + goto error; } } @@ -784,16 +811,23 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -6; + ret = -6; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, use_ob ? OUTBOUND: INBOUND, use_ob, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; }
10 years, 3 months
1
0
0
0
git:4.1: rr: Fix memory leak when using outbound
by Hugh Waite
Module: sip-router Branch: 4.1 Commit: 2d49bc59bb8084bfb8f4e1c89210d9e8c35781a8 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2d49bc5…
Author: Hugh Waite <hugh.waite(a)acision.com> Committer: Hugh Waite <hugh.waite(a)acision.com> Date: Thu Oct 2 18:37:00 2014 +0100 rr: Fix memory leak when using outbound - Flow token memory is freed after building the rr header --- modules/rr/record.c | 82 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 58 insertions(+), 24 deletions(-) diff --git a/modules/rr/record.c b/modules/rr/record.c index 3ccd452..00fa024 100644 --- a/modules/rr/record.c +++ b/modules/rr/record.c @@ -375,11 +375,12 @@ static int copy_flow_token(str *token, struct sip_msg *_m) int record_route(struct sip_msg* _m, str *params) { struct lump* l, *l2; - str user; + str user = {NULL, 0}; struct to_body* from = NULL; str* tag; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; @@ -406,7 +407,8 @@ int record_route(struct sip_msg* _m, str *params) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; tag = &from->tag_value; @@ -426,17 +428,20 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -5; + ret = -5; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_REALMS, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_REALMS, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -6; + ret = -6; + goto error; } if (build_rr(l, l2, &user, tag, params, OUTBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } } @@ -444,17 +449,24 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } if (build_rr(l, l2, &user, tag, params, INBOUND, sips) < 0) { LM_ERR("failed to insert inbound Record-Route\n"); - return -4; + ret = -4; + goto error; } /* reset the rr_param buffer */ rr_param_buf.len = 0; - return 0; + ret = 0; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } @@ -470,7 +482,7 @@ int record_route(struct sip_msg* _m, str *params) */ int record_route_preset(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; struct to_body* from; struct lump* l; char* hdr, *p; @@ -479,6 +491,7 @@ int record_route_preset(struct sip_msg* _m, str* _data) char *rr_prefix; int rr_prefix_len; int sips; + int ret = 0; sips = rr_is_sips(_m); if(sips==0) { @@ -513,7 +526,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; } @@ -521,7 +535,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T); if (!l) { LM_ERR("failed to create lump anchor\n"); - return -3; + ret = -3; + goto error; } hdr_len = rr_prefix_len; @@ -544,7 +559,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) hdr = pkg_malloc(hdr_len); if (!hdr) { LM_ERR("no pkg memory left\n"); - return -4; + ret = -4; + goto error; } p = hdr; @@ -581,9 +597,15 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (!insert_new_lump_after(l, hdr, hdr_len, 0)) { LM_ERR("failed to insert new lump\n"); pkg_free(hdr); - return -5; + ret = -5; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } /*! @@ -723,12 +745,13 @@ lump_err: int record_route_advertised_address(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; str *tag = NULL; struct lump* l; struct lump* l2; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; user.s = 0; @@ -753,7 +776,8 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } tag = &((struct to_body*)_m->from->parsed)->tag_value; } @@ -765,18 +789,21 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_PROTO, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_PROTO, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -4; + ret = -4; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, OUTBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -5; + ret = -5; + goto error; } } @@ -784,14 +811,21 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -6; + ret = -6; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, INBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; }
10 years, 3 months
2
1
0
0
git:master: rr: Fix memory leak when using outbound
by Hugh Waite
Module: sip-router Branch: master Commit: 44e29820a759405adb7657334e86ea474196e6fd URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=44e2982…
Author: Hugh Waite <hugh.waite(a)acision.com> Committer: Hugh Waite <hugh.waite(a)acision.com> Date: Thu Oct 2 18:37:00 2014 +0100 rr: Fix memory leak when using outbound - Flow token memory is freed after building the rr header --- modules/rr/record.c | 82 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 58 insertions(+), 24 deletions(-) diff --git a/modules/rr/record.c b/modules/rr/record.c index 4fda746..a521092 100644 --- a/modules/rr/record.c +++ b/modules/rr/record.c @@ -375,11 +375,12 @@ static int copy_flow_token(str *token, struct sip_msg *_m) int record_route(struct sip_msg* _m, str *params) { struct lump* l, *l2; - str user; + str user = {NULL, 0}; struct to_body* from = NULL; str* tag; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; @@ -406,7 +407,8 @@ int record_route(struct sip_msg* _m, str *params) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; tag = &from->tag_value; @@ -426,17 +428,20 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -5; + ret = -5; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_REALMS, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_REALMS, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -6; + ret = -6; + goto error; } if (build_rr(l, l2, &user, tag, params, OUTBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } } @@ -444,17 +449,24 @@ int record_route(struct sip_msg* _m, str *params) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } if (build_rr(l, l2, &user, tag, params, INBOUND, sips) < 0) { LM_ERR("failed to insert inbound Record-Route\n"); - return -4; + ret = -4; + goto error; } /* reset the rr_param buffer */ rr_param_buf.len = 0; - return 0; + ret = 0; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } @@ -470,7 +482,7 @@ int record_route(struct sip_msg* _m, str *params) */ int record_route_preset(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; struct to_body* from; struct lump* l; char* hdr, *p; @@ -479,6 +491,7 @@ int record_route_preset(struct sip_msg* _m, str* _data) char *rr_prefix; int rr_prefix_len; int sips; + int ret = 0; sips = rr_is_sips(_m); if(sips==0) { @@ -513,7 +526,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } from = (struct to_body*)_m->from->parsed; } @@ -521,7 +535,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T); if (!l) { LM_ERR("failed to create lump anchor\n"); - return -3; + ret = -3; + goto error; } hdr_len = rr_prefix_len; @@ -544,7 +559,8 @@ int record_route_preset(struct sip_msg* _m, str* _data) hdr = pkg_malloc(hdr_len); if (!hdr) { LM_ERR("no pkg memory left\n"); - return -4; + ret = -4; + goto error; } p = hdr; @@ -581,9 +597,15 @@ int record_route_preset(struct sip_msg* _m, str* _data) if (!insert_new_lump_after(l, hdr, hdr_len, 0)) { LM_ERR("failed to insert new lump\n"); pkg_free(hdr); - return -5; + ret = -5; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; } /*! @@ -723,12 +745,13 @@ lump_err: int record_route_advertised_address(struct sip_msg* _m, str* _data) { - str user; + str user = {NULL, 0}; str *tag = NULL; struct lump* l; struct lump* l2; int use_ob = rr_obb.use_outbound ? rr_obb.use_outbound(_m) : 0; int sips; + int ret = 0; user.len = 0; user.s = 0; @@ -753,7 +776,8 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) if (append_fromtag) { if (parse_from_header(_m) < 0) { LM_ERR("From parsing failed\n"); - return -2; + ret = -2; + goto error; } tag = &((struct to_body*)_m->from->parsed)->tag_value; } @@ -765,18 +789,21 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -3; + ret = -3; + goto error; } l = insert_cond_lump_after(l, COND_IF_DIFF_PROTO, 0); l2 = insert_cond_lump_before(l2, COND_IF_DIFF_PROTO, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); - return -4; + ret = -4; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, OUTBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -5; + ret = -5; + goto error; } } @@ -784,14 +811,21 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) l2 = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, 0); if (!l || !l2) { LM_ERR("failed to create an anchor\n"); - return -6; + ret = -6; + goto error; } if (build_advertised_rr(l, l2, _data, &user, tag, INBOUND, sips) < 0) { LM_ERR("failed to insert outbound Record-Route\n"); - return -7; + ret = -7; + goto error; } - return 1; + ret = 1; +error: + if ((use_ob == 1) || (use_ob == 2)) + if (user.s != NULL) + pkg_free(user.s); + return ret; }
10 years, 3 months
3
2
0
0
git:master: test/unit: updated test units 8 and 9
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 0921a4f6a2215b3e60bcc0dee4afe826f55a91d2 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0921a4f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Oct 2 17:58:09 2014 +0200 test/unit: updated test units 8 and 9 --- test/unit/8.sh | 11 ++++++----- test/unit/9.sh | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/unit/8.sh b/test/unit/8.sh index 6412484..3165e2f 100755 --- a/test/unit/8.sh +++ b/test/unit/8.sh @@ -27,12 +27,13 @@ cd $CTL_DIR # setup config file cp $CTLRC $CTLRC.bak -sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" $CTLRC -sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC -sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC +sed -i'' -e "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" $CTLRC +sed -i'' -e "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC +sed -i'' -e "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC +sed -i'' -e "s/# INSTALL_DBUID_TABLES=ask/INSTALL_DBUID_TABLES=yes/g" $CTLRC cp $DBCTL $DBCTL.bak -sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL +sed -i'' -e "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL ./$DBCTL create $tmp_name > /dev/null ret=$? @@ -46,4 +47,4 @@ fi ; mv $CTLRC.bak $CTLRC mv $DBCTL.bak $DBCTL -exit $ret \ No newline at end of file +exit $ret diff --git a/test/unit/9.sh b/test/unit/9.sh index a393b55..8e21626 100755 --- a/test/unit/9.sh +++ b/test/unit/9.sh @@ -26,8 +26,8 @@ cd $CTL_DIR # setup config file cp $CTLRC $CTLRC.bak cp $CTL $CTL.bak -sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC -sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $CTL +sed -i'' -e "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC +sed -i'' -e "s/TEST=\"false\"/TEST=\"true\"/g" $CTL ./$CTL avp list > /dev/null @@ -39,7 +39,7 @@ if [ "$ret" -eq 0 ] ; then fi ; if [ "$ret" -eq 0 ] ; then - ./$CTL lcr show > /dev/null + ./$CTL dispatcher show > /dev/null ret=$? fi ; @@ -47,4 +47,4 @@ fi ; mv $CTLRC.bak $CTLRC mv $CTL.bak $CTL -exit $ret \ No newline at end of file +exit $ret
10 years, 3 months
1
0
0
0
git:master: tsilo: fix clang warnings on inline prototypes in header files
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: bf8c98fc71cba974a2b98c36e2c9f6966768d529 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bf8c98f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Oct 2 17:34:41 2014 +0200 tsilo: fix clang warnings on inline prototypes in header files --- modules/tsilo/ts_hash.c | 4 ++-- modules/tsilo/ts_hash.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/tsilo/ts_hash.c b/modules/tsilo/ts_hash.c index f577c5e..089f425 100644 --- a/modules/tsilo/ts_hash.c +++ b/modules/tsilo/ts_hash.c @@ -44,7 +44,7 @@ struct ts_table *t_table = 0; * \brief Destroy a urecord and free memory * \param tma destroyed urecord */ -inline void free_ts_urecord(struct ts_urecord *urecord) +void free_ts_urecord(struct ts_urecord *urecord) { LM_DBG("destroying urecord %p\n", urecord); ts_transaction_t* ptr; @@ -389,7 +389,7 @@ ts_transaction_t* clone_ts_transaction(ts_transaction_t* ts) * \brief remove a transaction from the urecord transactions list * \param tma unlinked transaction */ -inline void remove_ts_transaction(ts_transaction_t* ts_t) +void remove_ts_transaction(ts_transaction_t* ts_t) { if (ts_t->next) ts_t->next->prev = ts_t->prev; diff --git a/modules/tsilo/ts_hash.h b/modules/tsilo/ts_hash.h index 060b38e..b895c26 100644 --- a/modules/tsilo/ts_hash.h +++ b/modules/tsilo/ts_hash.h @@ -173,7 +173,7 @@ ts_transaction_t* clone_ts_transaction(ts_transaction_t* ts); * \brief remove a transaction from the urecord transactions list * \param tma unlinked transaction */ -inline void remove_ts_transaction(ts_transaction_t* ts_t); +void remove_ts_transaction(ts_transaction_t* ts_t); -inline void free_ts_transaction(void *ts_t); +void free_ts_transaction(void *ts_t); #endif
10 years, 3 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200