diff --git a/phpBB/common.php b/phpBB/common.php
index f4f2784762..ce8a6a538a 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -196,6 +196,9 @@ include($phpbb_root_path . 'includes/auth.'.$phpEx);
 include($phpbb_root_path . 'includes/functions.'.$phpEx);
 include($phpbb_root_path . 'includes/db.'.$phpEx);
 
+// We do not need this any longer, unset for safety purposes
+unset($dbpasswd);
+
 //
 // Obtain and encode users IP
 //
diff --git a/phpBB/includes/db.php b/phpBB/includes/db.php
index 71472854c9..73ca94fc38 100644
--- a/phpBB/includes/db.php
+++ b/phpBB/includes/db.php
@@ -63,7 +63,4 @@ if(!$db->db_connect_id)
    message_die(CRITICAL_ERROR, "Could not connect to the database");
 }
 
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
-
 ?>
\ No newline at end of file