[quartz] Some extra checks (Coverity CID-31)

Paul Vriens Paul.Vriens at xs4all.nl
Tue Jun 27 13:53:28 CDT 2006


this is actually reported by Coverity as deadcode and is present in
several (20 or so) files (probably a copy-paste of the function).

Every step before the removed code we check ret against ERROR_SUCCESS so
the removed code is never reached.

I've opted for filling res with the result of register_key_guid (as is
done in the rest of this function and how it was probably intended)
instead of removing the 'deadcode'.

If this one is accepted I will produce more patches. If removing the
'deadcode' is better I'll produce other patches ;-).

  Use the return value of register_key_guid


 dlls/quartz/regsvr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c
index 74badcb..a6bd671 100644
--- a/dlls/quartz/regsvr.c
+++ b/dlls/quartz/regsvr.c
@@ -228,12 +228,12 @@ static HRESULT register_interfaces(struc
 	if (list->ps_clsid) {
-	    register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
+	    res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
 	    if (res != ERROR_SUCCESS) goto error_close_iid_key;
 	if (list->ps_clsid32) {
-	    register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
+	    res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
 	    if (res != ERROR_SUCCESS) goto error_close_iid_key;

More information about the wine-patches mailing list