This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new eb381ec  Fixes memory leak in header_rewrite when GeoIP is used
eb381ec is described below

commit eb381ec5299a4626cf1e8e9f51798658fc7bac00
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 ce637c32ce2a9bb510198f54192dabccbd88a228)
---
 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 92fa7a7..fa8ef6e 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);
     }
   }
 }

Reply via email to