diff --git a/oci8.c b/oci8.c index 96a6b29..15683c1 100644 --- a/oci8.c +++ b/oci8.c @@ -573,12 +573,8 @@ void php_oci_column_hash_dtor(zval *data) zend_list_close(column->stmtid); } - if (column->descid) { - if (GC_REFCOUNT(column->descid) == 1) - zend_list_close(column->descid); - else { - GC_DELREF(column->descid); - } + if (column->descid && !GC_DELREF(column->descid)) { + zend_list_free(column->descid); } if (column->data) { diff --git a/tests/gh-4-return-lob.phpt b/tests/gh-4-return-lob.phpt new file mode 100644 index 0000000..d1565a1 --- /dev/null +++ b/tests/gh-4-return-lob.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug GH-4 (Memory leak with long query/CLOB) with OCI_RETURN_LOBS +--EXTENSIONS-- +oci8 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +ok