diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 01c60780074..83b3c389d97 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2160,10 +2160,10 @@ class Form
$form.= $opt;
$i++;
}
- $form.= '';
-
- $this->db->free($result);
}
+
+ $form.= '';
+ $this->db->free($result);
return $form;
}
else