summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/userservice.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/services/userservice.php b/services/userservice.php
index a24c7ba..407632b 100644
--- a/services/userservice.php
+++ b/services/userservice.php
@@ -303,10 +303,14 @@ class UserService {
}
$arrWatch = array();
- if ($this->db->sql_numrows($dbresult) == 0)
- return $arrWatch;
- while ($row =& $this->db->sql_fetchrow($dbresult))
- $arrWatch[] = $row['watched'];
+ if ($this->db->sql_numrows($dbresult) == 0) {
+ $this->db->sql_freeresult($dbresult);
+ return $arrWatch;
+ }
+ while ($row =& $this->db->sql_fetchrow($dbresult)) {
+ $arrWatch[] = $row['watched'];
+ }
+ $this->db->sql_freeresult($dbresult);
return $arrWatch;
}