[sr-dev] git:master:6a001d3f: geoip2: fix logging for reload failures, initialize memory for db
Henning Westerholt
hw at gilawa.com
Wed Apr 13 10:21:41 CEST 2022
Module: kamailio
Branch: master
Commit: 6a001d3f90a8cfa2514b5b2781fc61dec50fc0c4
URL: https://github.com/kamailio/kamailio/commit/6a001d3f90a8cfa2514b5b2781fc61dec50fc0c4
Author: Henning Westerholt <hw at gilawa.com>
Committer: Henning Westerholt <hw at gilawa.com>
Date: 2022-04-13T08:20:54Z
geoip2: fix logging for reload failures, initialize memory for db
---
Modified: src/modules/geoip2/geoip2_pv.c
---
Diff: https://github.com/kamailio/kamailio/commit/6a001d3f90a8cfa2514b5b2781fc61dec50fc0c4.diff
Patch: https://github.com/kamailio/kamailio/commit/6a001d3f90a8cfa2514b5b2781fc61dec50fc0c4.patch
---
diff --git a/src/modules/geoip2/geoip2_pv.c b/src/modules/geoip2/geoip2_pv.c
index 0b50fd4447..0995ae2d25 100644
--- a/src/modules/geoip2/geoip2_pv.c
+++ b/src/modules/geoip2/geoip2_pv.c
@@ -490,6 +490,8 @@ int geoip2_init_pv(char *path)
{
int status;
_handle_GeoIP = shm_malloc(sizeof(struct MMDB_s));
+ memset(_handle_GeoIP, 0, sizeof(struct MMDB_s));
+
if (_handle_GeoIP == NULL)
{
SHM_MEM_ERROR;
@@ -522,9 +524,13 @@ int geoip2_reload_pv(char *path)
if(MMDB_SUCCESS != status)
{
LM_ERR("cannot reload GeoIP database file at: %s\n", path);
+
+ }
+ else
+ {
+ LM_INFO("reloaded GeoIP database file at: %s\n", path);
}
lock_release(lock);
- LM_INFO("reloaded GeoIP database file at: %s\n", path);
return status;
}
More information about the sr-dev
mailing list