]> granicus.if.org Git - php/commitdiff
Fix mem leak in PHP7
authorChristopher Jones <christopher.jones@oracle.com>
Mon, 14 Sep 2015 03:29:09 +0000 (13:29 +1000)
committerChristopher Jones <christopher.jones@oracle.com>
Mon, 14 Sep 2015 03:29:09 +0000 (13:29 +1000)
ext/oci8/oci8.c
ext/oci8/tests/bind_sqltnum.phpt

index 9144d48bafa53d7a17357f16ec7eb92e19a5559b..01b2414a9e34b84508020ece60da3e2d2ab98d35 100644 (file)
@@ -2748,6 +2748,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
                        placeholder = Z_REFVAL_P(array);
                else
                        placeholder = array;
+               zval_dtor(placeholder);
        } else {
                placeholder = return_value;
        }
index 93fc4809ec10d43f4a59bd1694bf09157ab3bfcc..3d29aeb4a8c65d7b69f73d13bb98c3ef84dbe6a7 100644 (file)
@@ -3,6 +3,10 @@ Bind with SQLT_NUM
 --SKIPIF--
 <?php
 if (!extension_loaded('oci8')) die("skip no oci8 extension");
+preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
+if (!(isset($matches[0]) && $matches[0] >= 12)) { 
+    die("skip works only with Oracle 12c or greater version of Oracle client libraries");
+}
 ?>
 --FILE--
 <?php
@@ -215,7 +219,7 @@ array(1) {
   ["NUMBER_T"]=>
   array(1) {
     [0]=>
-    string(127) "-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+    string(2) "-~"
   }
 }