server: Fix refcount "leak" and return correct error in create_named_object

Vitaliy Margolen wine-patch at kievinfo.com
Wed Sep 21 16:53:01 CDT 2005


See previously sent test that checks for correct behavior.

Vitaliy Margolen

changelog:
  server: Fix refcount "leak" and return correct error in create_named_object
-------------- next part --------------
Index: server/object.c
===================================================================
RCS file: /home/wine/wine/server/object.c,v
retrieving revision 1.33
diff -u -p -r1.33 object.c
--- server/object.c	9 Jun 2005 15:39:52 -0000	1.33
+++ server/object.c	21 Sep 2005 21:11:57 -0000
@@ -166,13 +166,13 @@ void *create_named_object( struct namesp
 
     if ((obj = find_object( namespace, name, len )))
     {
-        if (obj->ops == ops)
+        if (obj->ops != ops)
         {
-            set_error( STATUS_OBJECT_NAME_COLLISION );
-            return obj;
+            release_object( obj );
+            obj = NULL;
         }
-        set_error( STATUS_OBJECT_TYPE_MISMATCH );
-        return NULL;
+        set_error( STATUS_OBJECT_NAME_COLLISION );
+        return obj;
     }
     if (!(name_ptr = alloc_name( name, len ))) return NULL;
     if ((obj = alloc_object( ops )))


More information about the wine-patches mailing list