Fixes #5349 (but not the way reporter wants...).
# There's something in the way database_connect/close functions behave when
# implemented the way as in mysql module that I find a bit strange... because
# of that extra zend_list_addref() there to prevent default link disappearing
# if it's not assigned to variable, when it is, I guess its' reference count
# is at this point 2, I can do: open a db link and assign it to a variable,
# close the link and still use it afterwards.
if (ptr && (type==le_link || type==le_plink)) {
return_value->value.lval = PGG(default_link) = link;
return_value->type = IS_RESOURCE;
+ zend_list_addref(link);
efree(hashed_details);
return;
} else {
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- zend_list_delete(Z_LVAL_PP(pgsql_link));
+ zend_list_delete(id);
RETURN_TRUE;
}
/* }}} */