diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index 2a55657e1841a65d30a5d6b7e3e5f145bdc9e08d..e5a11108ce0ef7d32383845a21a79e84b939a93a 100644
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
@@ -1052,8 +1052,9 @@ class LDAP
     }
 
     /* Joining lines */
-    $line   = NULL;
-    $entry  = array();
+    $line       = NULL;
+    $entry      = array();
+    $entries    = array();
     $entryStart = -1;
     foreach ($fileLines as $lineNumber => $fileLine) {
       if (preg_match('/^ /', $fileLine)) {
@@ -1123,6 +1124,8 @@ class LDAP
         throw new LDIFImportException(sprintf(_('Error while importing dn: "%s", please check your LDIF from line %s on!'), $entry['dn'][0], $startLine));
       }
     }
+
+    return count($entries);
   }
 
   /*! \brief Function to Imports a single entry