[PATCH] remove if (attr) check

Marcus Meissner marcus at jet.franken.de
Tue Feb 19 02:29:51 CST 2008


Hi,

Coverity spotted that attr is dereferenced right afterwards
anyway (in NtOpenKey), so this check just delays the crash for
some instructions.

Ciao, Marcus
---
 dlls/ntdll/reg.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 9c9509d..25fb531 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -144,8 +144,7 @@ NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTR
  */
 NTSTATUS WINAPI RtlpNtOpenKey( PHANDLE retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr )
 {
-    if (attr)
-        attr->Attributes &= ~(OBJ_PERMANENT|OBJ_EXCLUSIVE);
+    attr->Attributes &= ~(OBJ_PERMANENT|OBJ_EXCLUSIVE);
     return NtOpenKey(retkey, access, attr);
 }
 
-- 
1.5.2.4



More information about the wine-patches mailing list