server: Fix initialization of mailslot objects that don't have a name.
authorAlexandre Julliard <julliard@winehq.org>
Thu, 28 Jan 2016 13:33:12 +0000 (22:33 +0900)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 28 Jan 2016 13:33:34 +0000 (22:33 +0900)
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
server/mailslot.c

index 0d93f42057a61ac5b908b3b23bbdd8d4cfa83dda..b135fb2f73f0fce435ae1daa873713e36d25f4ac 100644 (file)
@@ -403,7 +403,11 @@ static struct mailslot *create_mailslot( struct directory *root,
     struct mailslot *mailslot;
     int fds[2];
 
-    if (!name || !name->len) return alloc_object( &mailslot_ops );
+    if (!name || !name->len)
+    {
+        mailslot = alloc_object( &mailslot_ops );
+        goto init;
+    }
 
     if (!(obj = find_object_dir( root, name, attr, &new_name )))
     {
@@ -435,6 +439,7 @@ static struct mailslot *create_mailslot( struct directory *root,
     mailslot = create_object( dev->mailslots, &mailslot_ops, &new_name, NULL );
     release_object( dev );
 
+init:
     if (!mailslot) return NULL;
 
     mailslot->fd = NULL;