location-functions.pl: Remove accidently keept 2nd DB init call.

Message ID 20201202140408.6706-1-stefan.schantl@ipfire.org
State Accepted
Commit aa9dd5386cfac0ea069c4f6d51628e3d7ea56458
Headers
Series location-functions.pl: Remove accidently keept 2nd DB init call. |

Commit Message

Stefan Schantl Dec. 2, 2020, 2:04 p.m. UTC
  The get_full_country_name() function had an accidenlty and not longer
required call of the DB init function.

This is a waste of memory and a known problem, especially on systems
with less than 1GB of RAM, where the application which uses libloc in
such a redundant way crashes.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/cfgroot/location-functions.pl | 3 ---
 1 file changed, 3 deletions(-)
  

Patch

diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl
index b7465c5ef..fb97eb589 100644
--- a/config/cfgroot/location-functions.pl
+++ b/config/cfgroot/location-functions.pl
@@ -163,9 +163,6 @@  sub get_full_country_name($) {
 		# Grab location name from hash.
 		$name = $not_iso_3166_location{$code};
 	} else {
-		# Init libloc database connection.
-		my $db_handle = &init();
-
 		# Get the country name by using the location module.
 		$name = &Location::get_country_name($db_handle, $code);
 	}