server: Handle failure of mem_alloc in duplicate_token.

This commit is contained in:
Robert Shearman 2006-04-07 11:16:50 +01:00 committed by Alexandre Julliard
parent 9e0d0563c1
commit 0bf1c22cad

View File

@ -1031,6 +1031,12 @@ DECL_HANDLER(duplicate_token)
{
size_t size = FIELD_OFFSET( struct sid_and_attributes, sid.SubAuthority[group->sid.SubAuthorityCount] );
struct sid_and_attributes *newgroup = mem_alloc( size );
if (!newgroup)
{
release_object( token );
release_object( src_token );
return;
}
memcpy( newgroup, group, size );
list_add_tail( &token->groups, &newgroup->entry );
}