summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-08-11 11:27:50 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-08-11 11:28:07 +0200
commit183b853dc636883d4fb8134dcd39958dc628389e (patch)
tree6c7f25160074f43e94afd24470a6c6f762ed9335
parent66d9f4d9855b291bae5a966f4c6ca7cea0326ceb (diff)
parentdc108feab8d88f62d7fcba3d2c9a058432463118 (diff)
downloadphp-git-183b853dc636883d4fb8134dcd39958dc628389e.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #48585: com_load_typelib holds reference, fails on second call
-rw-r--r--NEWS4
-rw-r--r--ext/com_dotnet/com_com.c6
-rw-r--r--ext/com_dotnet/com_extension.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 3540a05092..1063e5772b 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,10 @@ PHP NEWS
. Fixed bug #79947 (Memory leak on invalid offset type in compound
assignment). (Nikita)
+- COM:
+ . Fixed bug #48585 (com_load_typelib holds reference, fails on second call).
+ (cmb)
+
- Gettext:
. Fixed bug #70574 (Tests fail due to relying on Linux fallback behavior for
gettext()). (Florian Engelhardt)
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index ab8c85e23b..0c174f992b 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -248,7 +248,7 @@ PHP_FUNCTION(com_create_instance)
TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached);
if (TL) {
- if (COMG(autoreg_on) && !cached) {
+ if (COMG(autoreg_on)) {
php_com_import_typelib(TL, mode, obj->code_page);
}
@@ -840,9 +840,7 @@ PHP_FUNCTION(com_load_typelib)
php_com_initialize();
pTL = php_com_load_typelib_via_cache(name, codepage, &cached);
if (pTL) {
- if (cached) {
- RETVAL_TRUE;
- } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
+ if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
RETVAL_TRUE;
}
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index c77d089188..5ae14815dd 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -251,9 +251,7 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
}
if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached)) != NULL) {
- if (!cached) {
- php_com_import_typelib(pTL, mode, COMG(code_page));
- }
+ php_com_import_typelib(pTL, mode, COMG(code_page));
ITypeLib_Release(pTL);
}
}