server: Fix refcount "leak" and return correct error in
create_named_object
Vitaliy Margolen
wine-patch at kievinfo.com
Fri Sep 23 07:49:31 CDT 2005
Spotted associated problem in mailslot.c - use this patch instead.
See previously sent test that checks for correct behavior.
mailslot.c should follow the same suit
Vitaliy Margolen
changelog:
server: Fix refcount "leak" and return correct error in create_named_object
server: mailslot.c: should not release original object on create
-------------- 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 )))
Index: server/mailslot.c
===================================================================
RCS file: /home/wine/wine/server/mailslot.c,v
retrieving revision 1.9
diff -u -p -r1.9 mailslot.c
--- server/mailslot.c 14 Jul 2005 12:18:05 -0000 1.9
+++ server/mailslot.c 22 Sep 2005 20:00:00 -0000
@@ -231,10 +231,7 @@ static struct mailslot *create_mailslot(
/* it already exists - there can only be one mailslot to read from */
if (get_error() == STATUS_OBJECT_NAME_COLLISION)
- {
- release_object( mailslot );
return NULL;
- }
mailslot->fd = NULL;
mailslot->write_fd = NULL;
More information about the wine-patches
mailing list