Skip to content

Commit

Permalink
Merge pull request #162 from Quy/1041-innodb
Browse files Browse the repository at this point in the history
#1041 Check that the result is a valid resource in innodb
  • Loading branch information
oldskool committed Nov 2, 2015
2 parents fbbb8e4 + 93da8c2 commit 6f2e3d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/dblayer/mysql_innodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function close()
{
if ($this->link_id)
{
if ($this->query_result)
if (is_resource($this->query_result))
@mysql_free_result($this->query_result);

return @mysql_close($this->link_id);
Expand Down
2 changes: 1 addition & 1 deletion include/dblayer/mysqli_innodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function close()
{
if ($this->link_id)
{
if ($this->query_result)
if ($this->query_result instanceof mysqli_result)
@mysqli_free_result($this->query_result);

return @mysqli_close($this->link_id);
Expand Down

0 comments on commit 6f2e3d6

Please sign in to comment.