fix segfault when failed to open magic file

This commit is contained in:
Antony Dovgal 2005-01-31 15:01:47 +00:00
parent 950632519b
commit 5e8cd3a2da

View File

@ -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;
}