summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 816e9dba99..16a84ffcd8 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3252,8 +3252,10 @@ PHP_FUNCTION(pg_lo_create)
if (pgsql_link == NULL) {
link = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(link);
- } else {
+ } else if ((Z_TYPE_P(pgsql_link) == IS_RESOURCE)) {
link = Z_RES_P(pgsql_link);
+ } else {
+ link = NULL;
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {