for doing performance stats without warnings in server-log. (Uwe Schindler)
- Fixed bug #29116 (Zend constant warning uses memory after free). (Marcus,
jdolecek at NetBSD dot org)
-- Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace). (Curt, Ilia)
+- Fixed bug #29114 (Potential double free in php_stat). (Sara)
+- Fixed bug #29075 (strnatcmp() incorrectly handles whitespace). (Curt, Ilia)
- Fixed bug #29049 (array sorting via user function/method does not validate
it). (Ilia)
- Fixed bug #29038 (extract() with EXTR_PREFIX_SAME prefixes empty strings).
if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || (errno != ENOENT && errno != ENOTDIR))) { /* fileexists() test must print no error */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
}
- efree(BG(CurrentStatFile));
- BG(CurrentStatFile) = NULL;
+ /* This could be null if a failed stat leads to a user error handler which calls a failed stat */
+ if (BG(CurrentStatFile)) {
+ efree(BG(CurrentStatFile));
+ BG(CurrentStatFile) = NULL;
+ }
#if HAVE_SYMLINK
if (!IS_LINK_OPERATION(type)) /* Don't require success for link operation */
#endif