com php-src: Fix remaining gcov valgrind issues: ext/oci8/oci8.c
| From: | Anatol Belski | Date: | Wed, 25 Nov 2015 02:20:22 +0000 |
| Subject: | com php-src: Fix remaining gcov valgrind issues: ext/oci8/oci8.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90010@lists.php.net to get a copy of this message | ||
Commit: 59d15ce9d472e0bc7dfb3c7b22baaa0275575e4e
Author: Christopher Jones <christopher.jones@oracle.com> Wed, 25 Nov 2015 12:42:27
+1100
Committer: Anatol Belski <ab@php.net> Wed, 25 Nov 2015 03:20:22 +0100
Parents: 030a97cb13a31b61b2f29bf66d47e49ed33e398b
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=59d15ce9d472e0bc7dfb3c7b22baaa0275575e4e
Log:
Fix remaining gcov valgrind issues
Changed paths:
M ext/oci8/oci8.c
Diff:
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 1030cec..cf5290c 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -2003,17 +2003,19 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len,
char
/* okay, the connection is open and the server is still alive */
connection->used_this_request = 1;
- tmp_val = zend_hash_index_find(&EG(regular_list), connection->id->handle);
- if ((tmp_val != NULL) && (Z_TYPE_P(tmp_val) == IS_RESOURCE)) {
- tmp = Z_RES_VAL_P(tmp_val);
- }
+ if (connection->id) {
+ tmp_val = zend_hash_index_find(&EG(regular_list), connection->id->handle);
+ if ((tmp_val != NULL) && (Z_TYPE_P(tmp_val) == IS_RESOURCE)) {
+ tmp = Z_RES_VAL_P(tmp_val);
+ }
- if ((tmp_val != NULL) && (tmp != NULL) &&
- (ZSTR_LEN(tmp->hash_key) == ZSTR_LEN(hashed_details.s)) &&
- (memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s), ZSTR_LEN(tmp->hash_key))
== 0)) {
- connection = tmp;
- ++GC_REFCOUNT(connection->id);
- /* do nothing */
+ if ((tmp_val != NULL) && (tmp != NULL) &&
+ (ZSTR_LEN(tmp->hash_key) == ZSTR_LEN(hashed_details.s)) &&
+ (memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s),
+ ZSTR_LEN(tmp->hash_key)) == 0)) {
+ connection = tmp;
+ ++GC_REFCOUNT(connection->id);
+ }
} else {
PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection);
/* Persistent connections: For old close semantics we artificially
@@ -2467,6 +2469,7 @@ int php_oci_connection_release(php_oci_connection *connection)
connection->svc = NULL;
connection->server = NULL;
connection->session = NULL;
+ connection->id = NULL;
connection->is_attached = connection->is_open = connection->rb_on_disconnect =
connection->used_this_request = 0;
connection->is_stub = 1;