Patch fix_pconnect for ibm_db2 Bug #74856
Patch version 2017-08-16 11:06 UTC
Return to Bug #74856 |
Download this patch
Patch Revisions:
Developer: vnkbabu@php.net
2429c2429
< zval *temp = NULL;
---
> zend_resource *temp = NULL;
2476c2476,2478
< temp = zend_hash_str_find_ind(&EG(persistent_list), hKey, hKeyLen );
---
> temp = zend_hash_str_find_ptr(&EG(persistent_list), hKey, hKeyLen );
> if ( temp && temp->type == le_pconn_struct) {
> conn_res = *pconn_res = (conn_handle *)temp->ptr;
2478,2479d2479
< if ( temp != NULL ) {
< entry = Z_RES_P(temp);
2482d2481
< #endif
2483a2483
> #endif
2788,2794c2788,2793
< newEntry = (ZEND_RESOURCE *)ecalloc(1,sizeof(ZEND_RESOURCE));
< memset(newEntry, 0, sizeof(newEntry));
< memset(&newEntrydata, 0, sizeof(newEntrydata));
< ZEND_Z_TYPE_RESOURCE(*newEntry) = le_pconn_struct;
< newEntry->ptr = conn_res;
< newEntrydata.value.res = newEntry;
< if (zend_hash_str_update(&EG(persistent_list), hKey, hKeyLen, &newEntrydata) == NULL) {
---
> zend_resource newPersistentRes;
> newPersistentRes.type = le_pconn_struct;
> newPersistentRes.ptr = conn_res;
> GC_REFCOUNT(&newPersistentRes) = 1;
> if (zend_hash_str_update_mem(&EG(persistent_list), hKey, hKeyLen, &newPersistentRes, sizeof(newPersistentRes)) == NULL) {
>
|