Module: kamailio
Branch: master
Commit: 0f9a833fcc7cbc306a5d47413f6449ccc5a37f59
URL:
https://github.com/kamailio/kamailio/commit/0f9a833fcc7cbc306a5d47413f6449c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-06T12:46:28+02:00
ipops: warning when too many dns containers are created
---
Modified: src/modules/ipops/ipops_pv.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0f9a833fcc7cbc306a5d47413f6449c…
Patch:
https://github.com/kamailio/kamailio/commit/0f9a833fcc7cbc306a5d47413f6449c…
---
diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index 6e9d86b5a6..1afc806541 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -95,6 +95,7 @@ sr_dns_item_t *sr_dns_add_item(str *name)
{
sr_dns_item_t *it = NULL;
unsigned int hashid = 0;
+ int n = 0;
hashid = get_hash1_raw(name->s, name->len);
@@ -105,7 +106,13 @@ sr_dns_item_t *sr_dns_add_item(str *name)
&& strncmp(it->name.s, name->s, name->len)==0)
return it;
it = it->next;
+ n++;
}
+ if(n > 20) {
+ LM_WARN("too many dns containers - adding nunmber %d - can fill memory\n",
+ n);
+ }
+
/* add new */
it = (sr_dns_item_t*)pkg_malloc(sizeof(sr_dns_item_t));
if(it==NULL)