Module: kamailio
Branch: 5.2
Commit: b7b1169a36099a1175314892df3f2a49e677c9a9
URL:
https://github.com/kamailio/kamailio/commit/b7b1169a36099a1175314892df3f2a4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-16T21:08:09+02:00
core: adjust the value for _pv_cache_counter
- reported by GH #1948
(cherry picked from commit 8e51acdd73e8e4ab95c79cc69fb53add7c6cfd38)
---
Modified: src/core/pvapi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b7b1169a36099a1175314892df3f2a4…
Patch:
https://github.com/kamailio/kamailio/commit/b7b1169a36099a1175314892df3f2a4…
---
diff --git a/src/core/pvapi.c b/src/core/pvapi.c
index 8e55e77e1b..878ae30f8e 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;