]> granicus.if.org Git - php/commitdiff
Fix invalid memory read on libpath
authortwosee <twose@qq.com>
Wed, 21 Oct 2020 05:17:16 +0000 (13:17 +0800)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 21 Oct 2020 08:07:07 +0000 (10:07 +0200)
Introduced in 3e33e1e86d15e262cd9e0224a9604e252f5d9284.

Closes GH-6362.

main/php_ini.c

index 53c08ae3c4c4538aaa44fb151ab77ab6d9989b8b..52e3a20ebf6851de847635a36141cfc72268fb14 100644 (file)
@@ -374,13 +374,13 @@ static void php_load_zend_extension_cb(void *arg)
 
                        efree(orig_libpath);
                        efree(err1);
-                       efree(libpath);
                }
 
 #ifdef PHP_WIN32
                if (!php_win32_image_compatible(handle, &err1)) {
                                php_error(E_CORE_WARNING, err1);
                                efree(err1);
+                               efree(libpath);
                                DL_UNLOAD(handle);
                                return;
                }