Fix refcount leak and return correct error in create_named_object.
This commit is contained in:
parent
8e74308a10
commit
9a7b41ad53
|
@ -166,14 +166,14 @@ void *create_named_object( struct namespace *namespace, const struct object_ops
|
|||
|
||||
if ((obj = find_object( namespace, name, len )))
|
||||
{
|
||||
if (obj->ops == ops)
|
||||
if (obj->ops != ops)
|
||||
{
|
||||
release_object( obj );
|
||||
obj = NULL;
|
||||
}
|
||||
set_error( STATUS_OBJECT_NAME_COLLISION );
|
||||
return obj;
|
||||
}
|
||||
set_error( STATUS_OBJECT_TYPE_MISMATCH );
|
||||
return NULL;
|
||||
}
|
||||
if (!(name_ptr = alloc_name( name, len ))) return NULL;
|
||||
if ((obj = alloc_object( ops )))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue