Skip to content

Commit

Permalink
ntdll: Don't leak objattr allocation in NtCreateSemaphore.
Browse files Browse the repository at this point in the history
  • Loading branch information
ishitatsuyuki authored and Paul Gofman committed Feb 20, 2024
1 parent 6db331d commit bb016e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dlls/ntdll/unix/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,15 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ

*handle = 0;
if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;

if (do_fsync())
return fsync_create_semaphore( handle, access, attr, initial, max );

if (do_esync())
return esync_create_semaphore( handle, access, attr, initial, max );

if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;

SERVER_START_REQ( create_semaphore )
{
req->access = access;
Expand Down

0 comments on commit bb016e1

Please sign in to comment.