summaryrefslogtreecommitdiff
path: root/ext/com_dotnet
diff options
context:
space:
mode:
Diffstat (limited to 'ext/com_dotnet')
-rw-r--r--ext/com_dotnet/com_dotnet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index 6c1c8fe95a..33a73bc2d9 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -275,8 +275,9 @@ PHP_FUNCTION(com_dotnet_create_instance)
char buf[1024];
char *err = php_win_err(hr);
snprintf(buf, sizeof(buf), "Failed to instantiate .Net object [%s] [0x%08x] %s", where, hr, err);
- if (err)
+ if (err && err[0]) {
LocalFree(err);
+ }
php_com_throw_exception(hr, buf TSRMLS_CC);
ZVAL_NULL(object);
return;