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
2024
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
March 2023
----- 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
14 participants
250 discussions
Start a n
N
ew thread
git:master:93011f82: misctest: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 93011f8292c568f67bf5127ae7e092ec773df1a7 URL:
https://github.com/kamailio/kamailio/commit/93011f8292c568f67bf5127ae7e092e…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T11:34:50Z misctest: convert to memory logging helper --- Modified: src/modules/misctest/misctest_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/93011f8292c568f67bf5127ae7e092e…
Patch:
https://github.com/kamailio/kamailio/commit/93011f8292c568f67bf5127ae7e092e…
--- diff --git a/src/modules/misctest/misctest_mod.c b/src/modules/misctest/misctest_mod.c index e0108b5a76b..575bc618e8b 100644 --- a/src/modules/misctest/misctest_mod.c +++ b/src/modules/misctest/misctest_mod.c @@ -244,7 +244,11 @@ static int misctest_memory_init(void) { alloc_lst = shm_malloc(sizeof(*alloc_lst)); if(alloc_lst == 0) + { + SHM_MEM_ERROR; goto error; + } + alloc_lst->chunks = 0; atomic_set_long(&alloc_lst->size, 0); atomic_set_int(&alloc_lst->no, 0); @@ -252,7 +256,10 @@ static int misctest_memory_init(void) goto error; rndt_lst = shm_malloc(sizeof(*rndt_lst)); if(rndt_lst == 0) + { + SHM_MEM_ERROR; goto error; + } rndt_lst->tests = 0; atomic_set_int(&rndt_lst->last_id, 0); if(lock_init(&rndt_lst->lock) == 0) @@ -469,7 +476,10 @@ static int mem_track(void *addr, unsigned long size) mc = shm_malloc(sizeof(*mc)); if(mc == 0) + { + SHM_MEM_ERROR; goto error; + } mc->addr = addr; mc->size = size; mc->flags = 0; @@ -782,7 +792,10 @@ static int mem_leak_time_test(unsigned long min, unsigned long max, tst = shm_malloc(sizeof(*tst)); if(tst == 0) + { + SHM_MEM_ERROR; goto error; + } memset(tst, 0, sizeof(*tst)); id = tst->id = atomic_add_int(&rndt_lst->last_id, 1); tst->min = min;
1 year, 8 months
1
0
0
0
git:master:41c814b7: imc: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 41c814b7cfbed2d89099840c29580d99b2a3cc47 URL:
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d9…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T11:32:56Z imc: convert to memory logging helper --- Modified: src/modules/imc/imc_cmd.c Modified: src/modules/imc/imc_mng.c --- Diff:
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d9…
Patch:
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d9…
--- diff --git a/src/modules/imc/imc_cmd.c b/src/modules/imc/imc_cmd.c index ea76e79816..4e0925ac6b 100644 --- a/src/modules/imc/imc_cmd.c +++ b/src/modules/imc/imc_cmd.c @@ -172,7 +172,7 @@ static int build_uri(str *res, str value, struct sip_uri *template) } if ((res->s = (char*)pkg_malloc(len)) == NULL) { - LM_ERR("No memory left\n"); + PKG_MEM_ERROR; return -1; } res->len = len; @@ -716,7 +716,7 @@ int imc_handle_invite(struct sip_msg* msg, imc_cmd_t *cmd, LM_ERR("Truncated message '%.*s'\n", STR_FMT(&body)); if ((cback_param = (del_member_t*)shm_malloc(sizeof(del_member_t))) == NULL) { - LM_ERR("No shared memory left\n"); + SHM_MEM_ERROR; goto error; } memset(cback_param, 0, sizeof(del_member_t)); diff --git a/src/modules/imc/imc_mng.c b/src/modules/imc/imc_mng.c index 73c2d68caf..89c32c80cb 100644 --- a/src/modules/imc/imc_mng.c +++ b/src/modules/imc/imc_mng.c @@ -56,7 +56,7 @@ int imc_htable_init(void) _imc_htable = (imc_hentry_p)shm_malloc(imc_hash_size*sizeof(imc_hentry_t)); if(_imc_htable == NULL) { - LM_ERR("no more shm memory\n"); + SHM_MEM_ERROR; return -1; } memset(_imc_htable, 0, imc_hash_size*sizeof(imc_hentry_t)); @@ -494,7 +494,7 @@ imc_room_p imc_add_room(str* name, str* domain, int flags) irp = (imc_room_p)shm_malloc(size); if(irp==NULL) { - LM_ERR("no more shm memory left\n"); + SHM_MEM_ERROR; return NULL; } memset(irp, 0, size); @@ -671,7 +671,7 @@ imc_member_p imc_add_member(imc_room_p room, str* user, str* domain, int flags) imp = (imc_member_p)shm_malloc(size); if(imp== NULL) { - LM_ERR("out of shm memory\n"); + SHM_MEM_ERROR; return NULL; } memset(imp, 0, size);
1 year, 8 months
1
0
0
0
git:master:246e25f0: nathelper: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 246e25f0e8c6ca933accf1bd57fea1f43e8346f5 URL:
https://github.com/kamailio/kamailio/commit/246e25f0e8c6ca933accf1bd57fea1f…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T11:27:56Z nathelper: convert to memory logging helper --- Modified: src/modules/nathelper/nathelper.c --- Diff:
https://github.com/kamailio/kamailio/commit/246e25f0e8c6ca933accf1bd57fea1f…
Patch:
https://github.com/kamailio/kamailio/commit/246e25f0e8c6ca933accf1bd57fea1f…
1 year, 8 months
1
0
0
0
git:master:0f559ea7: ipops: convert to memory logging helper, add missing error logging
by Henning Westerholt
Module: kamailio Branch: master Commit: 0f559ea761e2b1b140096d414b6f3d624068366b URL:
https://github.com/kamailio/kamailio/commit/0f559ea761e2b1b140096d414b6f3d6…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T10:40:16Z ipops: convert to memory logging helper, add missing error logging --- Modified: src/modules/ipops/ipops_pv.c --- Diff:
https://github.com/kamailio/kamailio/commit/0f559ea761e2b1b140096d414b6f3d6…
Patch:
https://github.com/kamailio/kamailio/commit/0f559ea761e2b1b140096d414b6f3d6…
--- diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c index 4eabbcac86c..c8cd5994063 100644 --- a/src/modules/ipops/ipops_pv.c +++ b/src/modules/ipops/ipops_pv.c @@ -117,14 +117,14 @@ sr_dns_item_t *sr_dns_add_item(str *name) it = (sr_dns_item_t*)pkg_malloc(sizeof(sr_dns_item_t)); if(it==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return NULL; } memset(it, 0, sizeof(sr_dns_item_t)); it->name.s = (char*)pkg_malloc(name->len+1); if(it->name.s==NULL) { - LM_ERR("no more pkg.\n"); + PKG_MEM_ERROR; pkg_free(it); return NULL; } @@ -154,8 +154,10 @@ int pv_parse_dns_name(pv_spec_t *sp, str *in) dpv = (dns_pv_t*)pkg_malloc(sizeof(dns_pv_t)); if(dpv==NULL) + { + PKG_MEM_ERROR; return -1; - + } memset(dpv, 0, sizeof(dns_pv_t)); p = in->s; @@ -473,7 +475,7 @@ int hn_pv_data_init(void) _hn_data = (struct _hn_pv_data*)pkg_malloc(sizeof(struct _hn_pv_data)+46+2*(hlen+1)); if(_hn_data==NULL) { - LM_ERR("no more pkg to init hostname data\n"); + PKG_MEM_ERROR; return -1; } memset(_hn_data, 0, sizeof(struct _hn_pv_data)+46+2*(hlen+1)); @@ -672,13 +674,13 @@ sr_srv_item_t *sr_srv_add_item (str *pvid, int findflg) pitem = (sr_srv_item_t *) pkg_malloc (sizeof (sr_srv_item_t)); if (!pitem) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; return NULL; } memset (pitem, 0, sizeof (sr_srv_item_t)); pitem->pvid.s = (char *) pkg_malloc (pvid->len + 1); if (!pitem->pvid.s) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; pkg_free (pitem); return NULL; } @@ -879,7 +881,7 @@ int pv_parse_srv_name (pv_spec_t *sp, str *in) return -1; dpv = (srv_pv_t *) pkg_malloc (sizeof (srv_pv_t)); if (!dpv) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; return -1; } memset (dpv, 0, sizeof (srv_pv_t)); @@ -1227,14 +1229,14 @@ sr_naptr_item_t *sr_naptr_add_item(str *pvid, int findflg) pitem = (sr_naptr_item_t *)pkg_malloc(sizeof (sr_naptr_item_t)); if (!pitem) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; return NULL; } memset(pitem, 0, sizeof(sr_naptr_item_t)); pitem->pvid.s = (char *)pkg_malloc(pvid->len + 1); if (!pitem->pvid.s) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; pkg_free(pitem); return NULL; } @@ -1314,7 +1316,7 @@ int pv_parse_naptr_name(pv_spec_t *sp, str *in) /* alloc/init pvid structure */ dpv = (naptr_pv_t *)pkg_malloc(sizeof(naptr_pv_t)); if (!dpv) { - LM_ERR ("No more pkg memory!\n"); + PKG_MEM_ERROR; return -1; } memset(dpv, 0, sizeof(naptr_pv_t));
1 year, 8 months
1
0
0
0
git:master:7be6d78f: msrp: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 7be6d78f5f9ee7aacef1a73321d4a384a7722077 URL:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:52:04Z msrp: convert to memory logging helper --- Modified: src/modules/msrp/msrp_cmap.c Modified: src/modules/msrp/msrp_parser.c Modified: src/modules/msrp/msrp_vars.c --- Diff:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
Patch:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
--- diff --git a/src/modules/msrp/msrp_cmap.c b/src/modules/msrp/msrp_cmap.c index 2fc6a8d740b..42100f4f905 100644 --- a/src/modules/msrp/msrp_cmap.c +++ b/src/modules/msrp/msrp_cmap.c @@ -73,7 +73,7 @@ int msrp_cmap_init(int msize) _msrp_cmap_head = (msrp_cmap_t*)shm_malloc(sizeof(msrp_cmap_t)); if(_msrp_cmap_head==NULL) { - LM_ERR("no more shm\n"); + SHM_MEM_ERROR; return -1; } memset(_msrp_cmap_head, 0, sizeof(msrp_cmap_t)); @@ -83,7 +83,7 @@ int msrp_cmap_init(int msize) _msrp_cmap_head->mapsize*sizeof(msrp_centry_t) ); if(_msrp_cmap_head->cslots==NULL) { - LM_ERR("no more shm.\n"); + SHM_MEM_ERROR; shm_free(_msrp_cmap_head); _msrp_cmap_head = NULL; return -1; @@ -234,7 +234,7 @@ int msrp_cmap_save(msrp_frame_t *mf) it = (msrp_citem_t*)shm_malloc(msize); if(it==NULL) { - LM_ERR("no more shm\n"); + SHM_MEM_ERROR; return -1; } memset(it, 0, msize); diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c index c701d6a6cad..0b36288b67c 100644 --- a/src/modules/msrp/msrp_parser.c +++ b/src/modules/msrp/msrp_parser.c @@ -270,7 +270,7 @@ int msrp_parse_headers(msrp_frame_t *mf) hdr = (msrp_hdr_t*)pkg_malloc(sizeof(msrp_hdr_t)); if(hdr==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } memset(hdr, 0, sizeof(msrp_hdr_t)); @@ -636,7 +636,7 @@ int msrp_explode_str(str_array_t *arr, str *in, str *del) larr = pkg_mallocxz(n * sizeof(str)); if(larr==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } @@ -712,7 +712,7 @@ int msrp_parse_hdr_uri_list(msrp_hdr_t *hdr) arr = pkg_mallocxz(sizeof(str_array_t)); if(arr==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } diff --git a/src/modules/msrp/msrp_vars.c b/src/modules/msrp/msrp_vars.c index 8384ff09107..b9d14b03b7a 100644 --- a/src/modules/msrp/msrp_vars.c +++ b/src/modules/msrp/msrp_vars.c @@ -339,7 +339,7 @@ int tr_msrp_eval_msrpuri(struct sip_msg *msg, tr_param_t *tp, int subtype, _tr_msrpuri.s = (char*)pkg_malloc((val->rs.len+1)*sizeof(char)); if(_tr_msrpuri.s==NULL) { - LM_ERR("no more private memory\n"); + PKG_MEM_ERROR; memset(&_tr_msrpuri, 0, sizeof(str)); memset(&_tr_parsed_msrpuri, 0, sizeof(msrp_uri_t)); return -1;
1 year, 8 months
1
0
0
0
git:master:6492a6f9: pike: use pkg_malloc/pkg_free instead of system malloc
by Henning Westerholt
Module: kamailio Branch: master Commit: 6492a6f905075fa73d911c345fe784f2d3c085e5 URL:
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f…
Author: Henning Westerholt <hw(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:50:20Z pike: use pkg_malloc/pkg_free instead of system malloc --- Modified: src/modules/pike/pike_top.c --- Diff:
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f…
Patch:
https://github.com/kamailio/kamailio/commit/6492a6f905075fa73d911c345fe784f…
--- diff --git a/src/modules/pike/pike_top.c b/src/modules/pike/pike_top.c index 6940e84ca6..c7894604b6 100644 --- a/src/modules/pike/pike_top.c +++ b/src/modules/pike/pike_top.c @@ -79,10 +79,10 @@ int pike_top_add_entry( unsigned char *ip_addr, int addr_len, unsigned int expires, pike_node_status_t status ) { struct TopListItem_t *new_item - = (struct TopListItem_t *)malloc(sizeof(struct TopListItem_t)); + = (struct TopListItem_t *)pkg_malloc(sizeof(struct TopListItem_t)); if(!new_item) { - SYS_MEM_ERROR; + PKG_MEM_ERROR; return -1; } print_addr(ip_addr, addr_len); @@ -119,7 +119,7 @@ void pike_top_list_clear() top_list_iter = top_list_root; while (top_list_iter) { ptr = top_list_iter->next; - free(top_list_iter); + pkg_free(top_list_iter); top_list_iter = ptr; } top_list_root = 0;
1 year, 8 months
1
0
0
0
git:master:fb1f01c3: pike: convert to memory logging helper, return error in case of allocation problem
by Henning Westerholt
Module: kamailio Branch: master Commit: fb1f01c333f9fc7189b6b3b6e39ddd28d30a5046 URL:
https://github.com/kamailio/kamailio/commit/fb1f01c333f9fc7189b6b3b6e39ddd2…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:44:07Z pike: convert to memory logging helper, return error in case of allocation problem --- Modified: src/modules/pike/ip_tree.c Modified: src/modules/pike/pike.c Modified: src/modules/pike/pike_top.c --- Diff:
https://github.com/kamailio/kamailio/commit/fb1f01c333f9fc7189b6b3b6e39ddd2…
Patch:
https://github.com/kamailio/kamailio/commit/fb1f01c333f9fc7189b6b3b6e39ddd2…
--- diff --git a/src/modules/pike/ip_tree.c b/src/modules/pike/ip_tree.c index a54351adefe..1f60f25e63e 100644 --- a/src/modules/pike/ip_tree.c +++ b/src/modules/pike/ip_tree.c @@ -114,7 +114,7 @@ int init_ip_tree(int maximum_hits) /* create the pike_root */ pike_root = (pike_ip_tree_t*)shm_malloc(sizeof(pike_ip_tree_t)); if (pike_root==0) { - LM_ERR("shm malloc failed\n"); + SHM_MEM_ERROR; goto error; } memset(pike_root, 0, sizeof(pike_ip_tree_t)); @@ -200,7 +200,7 @@ static inline pike_ip_node_t *new_ip_node(unsigned char byte) new_node = (pike_ip_node_t*)shm_malloc(sizeof(pike_ip_node_t)); if (!new_node) { - LM_ERR("no more shm mem\n"); + SHM_MEM_ERROR; return 0; } memset( new_node, 0, sizeof(pike_ip_node_t)); diff --git a/src/modules/pike/pike.c b/src/modules/pike/pike.c index 33dcfd64204..89c79e95a85 100644 --- a/src/modules/pike/pike.c +++ b/src/modules/pike/pike.c @@ -126,7 +126,7 @@ static int pike_init(void) /* init timer list */ pike_timer = (pike_list_link_t*)shm_malloc(sizeof(pike_list_link_t)); if (pike_timer==0) { - LM_ERR("cannot alloc shm mem for timer!\n"); + SHM_MEM_ERROR_FMT("for timer!\n"); goto error3; } pike_timer->next = pike_timer->prev = pike_timer; diff --git a/src/modules/pike/pike_top.c b/src/modules/pike/pike_top.c index e0bc3074620..6940e84ca67 100644 --- a/src/modules/pike/pike_top.c +++ b/src/modules/pike/pike_top.c @@ -80,7 +80,11 @@ int pike_top_add_entry( unsigned char *ip_addr, int addr_len, { struct TopListItem_t *new_item = (struct TopListItem_t *)malloc(sizeof(struct TopListItem_t)); - + if(!new_item) + { + SYS_MEM_ERROR; + return -1; + } print_addr(ip_addr, addr_len); DBG("pike_top_add_enrty(ip: %s, leaf_hits[%d,%d], hits[%d,%d]," " expires: %d, status: %d)",
1 year, 8 months
1
0
0
0
git:master:ab17b681: pdb: convert to memory logging helper, properly free memory in error cases
by Henning Westerholt
Module: kamailio Branch: master Commit: ab17b6811c94730f6428c218c9587d6365c9faa5 URL:
https://github.com/kamailio/kamailio/commit/ab17b6811c94730f6428c218c9587d6…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:29:53Z pdb: convert to memory logging helper, properly free memory in error cases --- Modified: src/modules/pdb/pdb.c --- Diff:
https://github.com/kamailio/kamailio/commit/ab17b6811c94730f6428c218c9587d6…
Patch:
https://github.com/kamailio/kamailio/commit/ab17b6811c94730f6428c218c9587d6…
--- diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c index c6656ee62b5..e818b06efb3 100644 --- a/src/modules/pdb/pdb.c +++ b/src/modules/pdb/pdb.c @@ -541,6 +541,7 @@ static int add_server(char *host, char *port) server->host = pkg_malloc(strlen(host)+1); if (server->host == NULL) { PKG_MEM_ERROR; + pkg_free(server); return -1; } strcpy(server->host, host); @@ -798,9 +799,14 @@ static int mod_init(void) return -1; } - global_id = (uint16_t*)shm_malloc(sizeof(uint16_t)); - - return 0; + global_id = (uint16_t*)shm_malloc(sizeof(uint16_t)); + if(!global_id) + { + SHM_MEM_ERROR; + shm_free(active); + return -1; + } + return 0; } static int child_init (int rank)
1 year, 8 months
1
0
0
0
git:master:3d60451b: db_cluster: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 3d60451ba47b14ce5e406a62b18547ad7d7d9165 URL:
https://github.com/kamailio/kamailio/commit/3d60451ba47b14ce5e406a62b18547a…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:16:31Z db_cluster: convert to memory logging helper --- Modified: src/modules/db_cluster/dbcl_api.c Modified: src/modules/db_cluster/dbcl_data.c --- Diff:
https://github.com/kamailio/kamailio/commit/3d60451ba47b14ce5e406a62b18547a…
Patch:
https://github.com/kamailio/kamailio/commit/3d60451ba47b14ce5e406a62b18547a…
--- diff --git a/src/modules/db_cluster/dbcl_api.c b/src/modules/db_cluster/dbcl_api.c index d1906e0f9d7..59449548b43 100644 --- a/src/modules/db_cluster/dbcl_api.c +++ b/src/modules/db_cluster/dbcl_api.c @@ -433,7 +433,7 @@ db1_con_t* db_cluster_init(const str* _dburl) cls->ref++; h = (db1_con_t*)pkg_malloc(sizeof(db1_con_t)); if (h==NULL) { - LM_ERR("out of pkg memory\n"); + PKG_MEM_ERROR; return NULL; } memset(h, 0, sizeof(db1_con_t)); diff --git a/src/modules/db_cluster/dbcl_data.c b/src/modules/db_cluster/dbcl_data.c index 6ff994974e9..af2d9459735 100644 --- a/src/modules/db_cluster/dbcl_data.c +++ b/src/modules/db_cluster/dbcl_data.c @@ -111,7 +111,7 @@ int dbcl_init_con(str *name, str *url) sc = (dbcl_con_t*)pkg_malloc(sizeof(dbcl_con_t)); if(sc==NULL) { - LM_ERR("no pkg memory\n"); + PKG_MEM_ERROR; return -1; } memset(sc, 0, sizeof(dbcl_con_t)); @@ -121,7 +121,7 @@ int dbcl_init_con(str *name, str *url) sc->sinfo = (dbcl_shared_t*)shm_malloc(sizeof(dbcl_shared_t)); if(sc->sinfo==NULL) { - LM_ERR("no shm memory\n"); + SHM_MEM_ERROR; pkg_free(sc); return -1; } @@ -357,7 +357,7 @@ int dbcl_init_cls(str *name, str *cons) sc = (dbcl_cls_t*)pkg_malloc(sizeof(dbcl_cls_t)); if(sc==NULL) { - LM_ERR("no pkg memory\n"); + PKG_MEM_ERROR; return -1; } memset(sc, 0, sizeof(dbcl_cls_t));
1 year, 8 months
1
0
0
0
git:master:19c9d56f: auth_ephemeral: convert to memory logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: 19c9d56f3f6a53433949d2dac5494ad7b3b393a0 URL:
https://github.com/kamailio/kamailio/commit/19c9d56f3f6a53433949d2dac5494ad…
Author: Pantelis Kolatsis <pk(a)gilawa.com> Committer: Henning Westerholt <hw(a)gilawa.com> Date: 2023-03-29T09:14:24Z auth_ephemeral: convert to memory logging helper --- Modified: src/modules/auth_ephemeral/auth_ephemeral_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/19c9d56f3f6a53433949d2dac5494ad…
Patch:
https://github.com/kamailio/kamailio/commit/19c9d56f3f6a53433949d2dac5494ad…
--- diff --git a/src/modules/auth_ephemeral/auth_ephemeral_mod.c b/src/modules/auth_ephemeral/auth_ephemeral_mod.c index 2a00c7879d9..717432caa89 100644 --- a/src/modules/auth_ephemeral/auth_ephemeral_mod.c +++ b/src/modules/auth_ephemeral/auth_ephemeral_mod.c @@ -223,7 +223,7 @@ static inline int add_secret(str _secret_key) secret_struct = (struct secret *) shm_malloc(sizeof(struct secret)); if (secret_struct == NULL) { - LM_ERR("unable to allocate shared memory\n"); + SHM_MEM_ERROR; return -1; } @@ -313,7 +313,7 @@ static int secret_param(modparam_t _type, void *_val) sval.s = (char *) shm_malloc(sizeof(char) * sval.len); if (sval.s == NULL) { - LM_ERR("unable to allocate shared memory\n"); + SHM_MEM_ERROR; return -1; } memcpy(sval.s, (char *) _val, sval.len); @@ -363,7 +363,7 @@ void autheph_rpc_add_secret(rpc_t* rpc, void* ctx) sval.s = shm_malloc(sizeof(char) * sval.len); if (sval.s == NULL) { - LM_ERR("Unable to allocate shared memory\n"); + SHM_MEM_ERROR; rpc->fault(ctx, 500, "Not enough memory"); return; }
1 year, 8 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
25
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
Results per page:
10
25
50
100
200