- Fileinfo:
. Fixed possible memory leak in finfo_open(). (Felipe)
+ . Fixed memory leak when calling the Finfo constructor twice. (Felipe)
- Intl:
. Fixed bug #60192 (SegFault when Collator not constructed
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
RETURN_FALSE;
}
+
+ if (object) {
+ struct finfo_object *finfo_obj = (struct finfo_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if (finfo_obj->ptr) {
+ magic_close(finfo_obj->ptr->magic);
+ efree(finfo_obj->ptr);
+ finfo_obj->ptr = NULL;
+ }
+ }
if (file_len == 0) {
file = NULL;
--- /dev/null
+--TEST--
+FileInfo - Calling the constructor twice
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+$x = new finfo;
+$x->finfo();
+
+echo "done!\n";
+
+?>
+--EXPECTF--
+done!
+
+