server: Fix a potential desktop reference leak.

This commit is contained in:
Alexandre Julliard 2008-06-26 16:49:23 +02:00
parent 93a02e7f65
commit 42e2c99ce2
1 changed files with 3 additions and 3 deletions

View File

@ -1963,6 +1963,9 @@ DECL_HANDLER(get_window_children)
atom_t atom = req->atom;
struct desktop *desktop = NULL;
get_req_unicode_str( &cls_name );
if (cls_name.len && !(atom = find_global_atom( NULL, &cls_name ))) return;
if (req->desktop)
{
if (!(desktop = get_desktop_obj( current->process, req->desktop, DESKTOP_ENUMERATE ))) return;
@ -1974,9 +1977,6 @@ DECL_HANDLER(get_window_children)
if (!parent && !(desktop = get_thread_desktop( current, 0 ))) return;
}
get_req_unicode_str( &cls_name );
if (cls_name.len && !(atom = find_global_atom( NULL, &cls_name ))) return;
if (parent)
total = get_children_windows( parent, atom, req->tid, NULL, 0 );
else