PMC-1042 Memory Leak using PM Function "executeQuery"

This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-08-09 10:42:38 -04:00
parent 013dd45d9c
commit 11dd7659d1
2 changed files with 2 additions and 1 deletions

View File

@@ -98,7 +98,7 @@ class MySQLiResultSet extends ResultSetCommon implements ResultSet {
*/
public function close()
{
if (is_resource($this->result)) {
if ($this->result instanceof mysqli_result) {
@mysqli_free_result($this->result);
}
$this->fields = array();

View File

@@ -308,6 +308,7 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter
while ($rs->next()) {
$result[$i ++] = $rs->getRow();
}
$rs->close();
$con->commit();
break;
case preg_match( "/^INSERT\s/i", $statement ):