Commit 9a7b41ad authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

Fix refcount leak and return correct error in create_named_object.

parent 8e74308a
...@@ -166,13 +166,13 @@ void *create_named_object( struct namespace *namespace, const struct object_ops ...@@ -166,13 +166,13 @@ void *create_named_object( struct namespace *namespace, const struct object_ops
if ((obj = find_object( namespace, name, len ))) if ((obj = find_object( namespace, name, len )))
{ {
if (obj->ops == ops) if (obj->ops != ops)
{ {
set_error( STATUS_OBJECT_NAME_COLLISION ); release_object( obj );
return obj; obj = NULL;
} }
set_error( STATUS_OBJECT_TYPE_MISMATCH ); set_error( STATUS_OBJECT_NAME_COLLISION );
return NULL; return obj;
} }
if (!(name_ptr = alloc_name( name, len ))) return NULL; if (!(name_ptr = alloc_name( name, len ))) return NULL;
if ((obj = alloc_object( ops ))) if ((obj = alloc_object( ops )))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment