diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-02-15 18:50:13 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-02-15 18:56:24 +0100 |
commit | 767fa3dc02f39b64015539d9948874947cf20d5d (patch) | |
tree | fc31f2b60deaf50d238a3ba0ec4c47c0186f81a4 /ext/com_dotnet | |
parent | 8946ad30009af055b5b2fed3044e61c78b7d77fb (diff) | |
download | php-git-767fa3dc02f39b64015539d9948874947cf20d5d.tar.gz |
Fix #77626: Persistence confusion in php_com_import_typelib()
We apply only the most minimal fix here, and will cater to the
unnecessary re-allocation for PHP-7.4.
We don't need to add a regression test, since bug39606.phpt and
bug77621.phpt already show the misbehavior.
Diffstat (limited to 'ext/com_dotnet')
-rw-r--r-- | ext/com_dotnet/com_typeinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 6da55f7477..6925e20379 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -184,7 +184,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa } const_name = php_com_olestring_to_string(bstr_ids, &len, codepage); - c.name = zend_string_init(const_name, len, 1); + c.name = zend_string_init(const_name, len, mode & CONST_PERSISTENT); // TODO: avoid reallocation??? efree(const_name); if(c.name == NULL) { @@ -200,7 +200,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa if (COMG(autoreg_verbose) && !compare_function(&results, &value, exists)) { php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", ZSTR_VAL(c.name)); } - zend_string_release_ex(c.name, 1); + zend_string_release_ex(c.name, mode & CONST_PERSISTENT); ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); continue; } |