]> granicus.if.org Git - php/commitdiff
Fix bug #6447
authorZeev Suraski <zeev@php.net>
Mon, 9 Oct 2000 11:48:16 +0000 (11:48 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 9 Oct 2000 11:48:16 +0000 (11:48 +0000)
ext/rpc/com/COM.c

index b7faa18dd4baeecb30e722ce6f2adcf58f059d25..782a797904de27cc080e3d6480b0dd6b3257ccb3 100644 (file)
@@ -697,6 +697,13 @@ static void do_COM_propput(pval *return_value, IDispatch *i_dispatch, pval *arg_
        hr = i_dispatch->lpVtbl->Invoke(i_dispatch, dispid, &IID_NULL,
                                                                        LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT,
                                                                        &dispparams, NULL, NULL, 0);
+       if (FAILED(hr)) {
+               error_message = php_COM_error_message(hr);
+               php_error(E_WARNING,"PropPut() failed:  %s\n", error_message);
+               LocalFree(error_message);
+               efree(propname);
+               RETURN_FALSE;
+       }
 
        dispparams.cArgs = 0;
        dispparams.cNamedArgs = 0;
@@ -705,15 +712,13 @@ static void do_COM_propput(pval *return_value, IDispatch *i_dispatch, pval *arg_
                                                                        LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET,
                                                                        &dispparams, &var_result, NULL, 0);
 
-       if (FAILED(hr)) {
-               error_message = php_COM_error_message(hr);
-               php_error(E_WARNING,"PropPut() failed:  %s\n", error_message);
-               LocalFree(error_message);
-               efree(propname);
-               RETURN_FALSE;
-       }
 
-       php_variant_to_pval(&var_result, return_value, 0);
+       if (SUCCEEDED(hr)) {
+               php_variant_to_pval(&var_result, return_value, 0);
+       } else {
+               *return_value = *value;
+               zval_copy_ctor(return_value);
+       }
 
        efree(propname);
 }