fix NULL deref with circular refs
[m6w6/ext-pq] / src / php_pqcur.c
index 16057e8c5420a20d4117efa8057b4ddbb53e9bdd..1ff10da22c5e9d103a2b0dc2aeacaa30a669efee 100644 (file)
@@ -31,7 +31,7 @@ static HashTable php_pqcur_object_prophandlers;
 
 static void cur_close(php_pqcur_object_t *obj TSRMLS_DC)
 {
-       if (obj->intern->open) {
+       if (obj->intern->open && obj->intern->conn->intern) {
                PGresult *res;
                smart_str cmd = {0};