server: Handle failure of mem_alloc in duplicate_token.
This commit is contained in:
parent
9e0d0563c1
commit
0bf1c22cad
|
@ -1031,6 +1031,12 @@ DECL_HANDLER(duplicate_token)
|
||||||
{
|
{
|
||||||
size_t size = FIELD_OFFSET( struct sid_and_attributes, sid.SubAuthority[group->sid.SubAuthorityCount] );
|
size_t size = FIELD_OFFSET( struct sid_and_attributes, sid.SubAuthority[group->sid.SubAuthorityCount] );
|
||||||
struct sid_and_attributes *newgroup = mem_alloc( size );
|
struct sid_and_attributes *newgroup = mem_alloc( size );
|
||||||
|
if (!newgroup)
|
||||||
|
{
|
||||||
|
release_object( token );
|
||||||
|
release_object( src_token );
|
||||||
|
return;
|
||||||
|
}
|
||||||
memcpy( newgroup, group, size );
|
memcpy( newgroup, group, size );
|
||||||
list_add_tail( &token->groups, &newgroup->entry );
|
list_add_tail( &token->groups, &newgroup->entry );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue