diff options
| author | Christopher Jones <sixd@php.net> | 2008-01-15 20:47:50 +0000 |
|---|---|---|
| committer | Christopher Jones <sixd@php.net> | 2008-01-15 20:47:50 +0000 |
| commit | c19506f6804f3bfa4a82ca7a1672b3ff73c4c056 (patch) | |
| tree | ae9c2864f3e68ec270d1123a38f04b9a3cc4514a /ext/oci8/oci8.c | |
| parent | 810c41e096b3869e2db67652911aa5a0f069200f (diff) | |
| download | php-git-c19506f6804f3bfa4a82ca7a1672b3ff73c4c056.tar.gz | |
MFB: fix #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory)
Diffstat (limited to 'ext/oci8/oci8.c')
| -rw-r--r-- | ext/oci8/oci8.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 01cc89b555..10731944b3 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1645,7 +1645,10 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR php_oci_descriptor *descriptor; ub4 lob_length; int column_size; - zstr lob_buffer, zstr_data = ZSTR(column->data); + int lob_fetch_status; + zstr lob_buffer; + zstr zstr_data = ZSTR(column->data); + php_oci_lob_type lob_type; if (column->indicator == -1) { /* column is NULL */ ZVAL_NULL(value); @@ -1674,17 +1677,15 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR } if (column->data_type != SQLT_RDD && (mode & PHP_OCI_RETURN_LOBS)) { - php_oci_lob_type lob_type; /* PHP_OCI_RETURN_LOBS means that we want the content of the LOB back instead of the locator */ - if (php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length TSRMLS_CC)) { + lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length TSRMLS_CC); + lob_fetch_status |= (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0); + php_oci_temp_lob_close(descriptor); + if (lob_fetch_status) { ZVAL_FALSE(value); return 1; } - - if (php_oci_lob_get_type(descriptor, &lob_type TSRMLS_CC) > 0) { - return 1; - } switch (lob_type) { case OCI_IS_CLOB: |
