summaryrefslogtreecommitdiffstatshomepage
path: root/services/bookmarkservice.php
diff options
context:
space:
mode:
authorGravatar mensonge2009-02-03 15:32:23 +0000
committerGravatar mensonge2009-02-03 15:32:23 +0000
commitc0e46287e41ac5be4c4832c915c8e2ba78b9a1d5 (patch)
tree98aef584a8d4b91c5a618bbbfa11953cba4ad9c2 /services/bookmarkservice.php
parent4aaef1823e5e37f02bc18078ccb67217b8cdbcb7 (diff)
downloadscuttle-c0e46287e41ac5be4c4832c915c8e2ba78b9a1d5.tar.gz
scuttle-c0e46287e41ac5be4c4832c915c8e2ba78b9a1d5.zip
Refactoring: free few sql results
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@247 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/bookmarkservice.php')
-rw-r--r--services/bookmarkservice.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/services/bookmarkservice.php b/services/bookmarkservice.php
index 4b000b4..1d72bc8 100644
--- a/services/bookmarkservice.php
+++ b/services/bookmarkservice.php
@@ -32,10 +32,12 @@ class BookmarkService {
}
if ($row =& $this->db->sql_fetchrow($dbresult)) {
- return $row;
+ $output = $row;
} else {
- return false;
+ $output = false;
}
+ $this->db->sql_freeresult($dbresult);
+ return $output;
}
function & getBookmark($bid, $include_tags = false) {
@@ -52,10 +54,12 @@ class BookmarkService {
$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
$row['tags'] = $b2tservice->getTagsForBookmark($bid);
}
- return $row;
+ $output = $row;
} else {
- return false;
+ $output = false;
}
+ $this->db->sql_freeresult($dbresult);
+ return $output;
}
function getBookmarkByAddress($address) {
@@ -103,7 +107,9 @@ class BookmarkService {
if (!($dbresult = & $this->db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db);
}
- return ($this->db->sql_fetchfield(0, 0) > 0);
+ $ouput = ($this->db->sql_fetchfield(0, 0) > 0);
+ $this->db->sql_freeresult($dbresult);
+ return $output;
}
// Adds a bookmark to the database.
@@ -390,6 +396,7 @@ class BookmarkService {
$bookmarks[] = $row;
}
+ $this->db->sql_freeresult($dbresult);
$output = array ('bookmarks' => $bookmarks, 'total' => $total);
return $output;
}
@@ -451,7 +458,10 @@ class BookmarkService {
if (!($dbresult = & $this->db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not get vars', '', __LINE__, __FILE__, $sql, $this->db);
}
- return $this->db->sql_fetchfield(0, 0) - 1;
+
+ $output = $this->db->sql_fetchfield(0, 0) - 1;
+ $this->db->sql_freeresult($dbresult);
+ return $output;
}
function normalize($address) {