This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/8.0.x by this push:
new 0de4b23 Fixes memory leak in header_rewrite when GeoIP is used
0de4b23 is described below
commit 0de4b23a070f19e0ee73a005e703d22526e7dbe1
Author: Randall Meyer <[email protected]>
AuthorDate: Sat Oct 20 08:46:05 2018 -0700
Fixes memory leak in header_rewrite when GeoIP is used
This leaks during initialization, not per request.
(cherry picked from commit 9c4f847dd6df3b875782f9adb54146250f333d0c)
---
plugins/header_rewrite/header_rewrite.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/plugins/header_rewrite/header_rewrite.cc
b/plugins/header_rewrite/header_rewrite.cc
index fb25b41..b4aaacd 100644
--- a/plugins/header_rewrite/header_rewrite.cc
+++ b/plugins/header_rewrite/header_rewrite.cc
@@ -46,7 +46,10 @@ initGeoIP()
if (!gGeoIP[dbs[i]] && GeoIP_db_avail(dbs[i])) {
// GEOIP_STANDARD seems to break threaded apps...
gGeoIP[dbs[i]] = GeoIP_open_type(dbs[i], GEOIP_MMAP_CACHE);
- TSDebug(PLUGIN_NAME, "initialized GeoIP-DB[%d] %s", dbs[i],
GeoIP_database_info(gGeoIP[dbs[i]]));
+
+ char *db_info = GeoIP_database_info(gGeoIP[dbs[i]]);
+ TSDebug(PLUGIN_NAME, "initialized GeoIP-DB[%d] %s", dbs[i], db_info);
+ free(db_info);
}
}
}