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 ivyl committed May 23, 2024
1 parent a94be92 commit f6abe13
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 @@ -272,14 +272,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 f6abe13

Please sign in to comment.