Browse Source

fix segfault when failed to open magic file

PHP-5.1
Antony Dovgal 22 years ago
parent
commit
5e8cd3a2da
  1. 2
      ext/fileinfo/fileinfo.c

2
ext/fileinfo/fileinfo.c

@ -269,8 +269,8 @@ PHP_FUNCTION(finfo_open)
if (magic_load(finfo->magic, file) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
efree(finfo);
magic_close(finfo->magic);
efree(finfo);
RETURN_FALSE;
}

Loading…
Cancel
Save