Module: kamailio
Branch: master
Commit: 8e51acdd73e8e4ab95c79cc69fb53add7c6cfd38
URL:
https://github.com/kamailio/kamailio/commit/8e51acdd73e8e4ab95c79cc69fb53ad…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-13T12:40:24+02:00
core: adjust the value for _pv_cache_counter
- reported by GH #1948
---
Modified: src/core/pvapi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8e51acdd73e8e4ab95c79cc69fb53ad…
Patch:
https://github.com/kamailio/kamailio/commit/8e51acdd73e8e4ab95c79cc69fb53ad…
---
diff --git a/src/core/pvapi.c b/src/core/pvapi.c
index 59a76831e8..27a23612c7 100644
--- a/src/core/pvapi.c
+++ b/src/core/pvapi.c
@@ -287,6 +287,7 @@ int pv_cache_drop(void)
pvi->spec.pvp.pvn.nfree((void*)(&pvi->spec.pvp.pvn));
}
pkg_free(pvi);
+ _pv_cache_counter--;
return 1;
}
pvp = pvi;
@@ -309,6 +310,7 @@ int pv_cache_drop(void)
pvi->spec.pvp.pvn.nfree((void*)(&pvi->spec.pvp.pvn));
}
pkg_free(pvi);
+ _pv_cache_counter--;
return 1;
}
pvp = pvi;
@@ -364,6 +366,7 @@ pv_spec_t* pv_cache_add(str *name)
pvn->pvid = pvid;
pvn->next = _pv_cache[pvid%PV_CACHE_SIZE];
_pv_cache[pvid%PV_CACHE_SIZE] = pvn;
+ _pv_cache_counter++;
LM_DBG("pvar [%.*s] added in cache\n", name->len, name->s);
return &pvn->spec;