Commit 52f9aced authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

server: Clear last error when creating object without name.

parent b5c12faa
......@@ -287,7 +287,11 @@ void *create_named_object_dir( struct directory *root, const struct unicode_str
struct object *obj, *new_obj = NULL;
struct unicode_str new_name;
if (!name || !name->len) return alloc_object( ops );
if (!name || !name->len)
{
if ((new_obj = alloc_object( ops ))) clear_error();
return new_obj;
}
if (!(obj = find_object_dir( root, name, attributes, &new_name ))) return NULL;
if (!new_name.len)
......
......@@ -671,7 +671,11 @@ static struct named_pipe *create_named_pipe( struct directory *root, const struc
struct named_pipe *pipe = NULL;
struct unicode_str new_name;
if (!name || !name->len) return alloc_object( &named_pipe_ops );
if (!name || !name->len)
{
if ((pipe = alloc_object( &named_pipe_ops ))) clear_error();
return pipe;
}
if (!(obj = find_object_dir( root, name, attr, &new_name )))
{
......
......@@ -242,7 +242,11 @@ void *create_named_object( struct namespace *namespace, const struct object_ops
{
struct object *obj;
if (!name || !name->len) return alloc_object( ops );
if (!name || !name->len)
{
if ((obj = alloc_object( ops ))) clear_error();
return obj;
}
if ((obj = find_object( namespace, name, attributes )))
{
......
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