]> granicus.if.org Git - php/commitdiff
Fixed valgrind issue
authorTianfang Yang <tianfyan@php.net>
Mon, 16 Oct 2017 23:16:30 +0000 (19:16 -0400)
committerTianfang Yang <tianfyan@php.net>
Mon, 16 Oct 2017 23:16:30 +0000 (19:16 -0400)
NEWS
ext/oci8/oci8_interface.c
ext/oci8/package.xml
ext/oci8/tests/driver_name.phpt

diff --git a/NEWS b/NEWS
index 00749e91df1aaf5b2f40177a41c75a3a76b87167..8d451c6e89b0ea26fbec2e0cdc1fc03ea149a298 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,9 @@ PHP                                                                        NEWS
   . Fixed bug #75301 (Exif extension has built in revision version). (Peter
     Kokot)
 
+- OCI8:
+  . Fixed valgrind issue. (Tianfang Yang)
+
 - OpenSSL:
   . Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
 
index 5dabefcd2cf69f77b2e903ffdc78111bfed16d4a..7b9b79ffbf9bee2f04239f9607e6f635ec054919 100644 (file)
@@ -1611,14 +1611,15 @@ PHP_FUNCTION(oci_close)
        }
 
        PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
-       if (GC_REFCOUNT(connection->id) == 2) /* CHANGED VERSION::PHP7
-                                                                                        Changed the refCount to 2 since
-                                                                                        internally Zend engine increments
-                                                                                        RefCount value by 1 */
+       if (GC_REFCOUNT(connection->id) == 2) { /* CHANGED VERSION::PHP7
+                                                                                          Changed the refCount to 2 since
+                                                                                          internally Zend engine increments
+                                                                                          RefCount value by 1 */
+               /* Unregister Oracle TAF */
+               php_oci_unregister_taf_callback(connection);
+
                zend_list_close(connection->id);
-       
-       /* Unregister Oracle TAF */
-       php_oci_unregister_taf_callback(connection);
+       }
 
        /* ZVAL_NULL(z_connection); */
        
index 763d8c9653f5fd69327ba165a19eb37c3b929b19..45e6eb5b173ddb22508903c6f0df3b324394fcce 100644 (file)
@@ -56,8 +56,8 @@ Interoperability Support" (ID 207303.1) for details.
  <time>12:00:00</time>
 
   <version>
-   <release>2.1.7</release>
-   <api>2.1.7</api>
+   <release>2.1.8</release>
+   <api>2.1.8</api>
   </version>
   <stability>
    <release>stable</release>
@@ -66,7 +66,7 @@ Interoperability Support" (ID 207303.1) for details.
   <license uri="http://www.php.net/license">PHP</license>
   <notes>
 This version is for PHP 7 only.
-Added oci_unregister_taf_callback()    
+Fixed reference counting and memory issues. (Dmitry, Tianfang)
   </notes>
  <contents>
   <dir name="/">
@@ -476,6 +476,22 @@ Added oci_unregister_taf_callback()
  </extsrcrelease>
  <changelog>
 
+<release>
+  <version>
+   <release>2.1.7</release>
+   <api>2.1.7</api>
+  </version>
+  <stability>
+   <release>stable</release>
+   <api>stable</api>
+  </stability>
+  <license uri="http://www.php.net/license">PHP</license>
+  <notes>
+This version is for PHP 7 only.
+Added oci_unregister_taf_callback()
+  </notes>
+</release>
+
 <release>
   <version>
    <release>2.1.6</release>
index 1ea885bf4f8c466d79daf1fb070e3b64e764f31f..a5be162e40eaac6e8e852460bf89f110176995d1 100644 (file)
@@ -57,11 +57,11 @@ function get_attr($conn)
 ?>
 --EXPECT--
 **Test 1.1 - Default values for the attribute **************
-The value of DRIVER_NAME is PHP OCI8 : 2.1.7
+The value of DRIVER_NAME is PHP OCI8 : 2.1.8
 
 ***Test 1.2 - Get the values from different connections **************
 Testing with oci_pconnect()
-The value of DRIVER_NAME is PHP OCI8 : 2.1.7
+The value of DRIVER_NAME is PHP OCI8 : 2.1.8
 Testing with oci_new_connect()
-The value of DRIVER_NAME is PHP OCI8 : 2.1.7
+The value of DRIVER_NAME is PHP OCI8 : 2.1.8
 Done