Skip to content

Commit c2bbaa0

Browse files
ishitatsuyukibylaws
authored andcommitted
ntdll: Don't leak objattr allocation in NtCreateSemaphore.
ValveSoftware/wine#219
1 parent a663bb1 commit c2bbaa0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dlls/ntdll/unix/sync.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,15 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
272272

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

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

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

282+
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
283+
283284
SERVER_START_REQ( create_semaphore )
284285
{
285286
req->access = access;

0 commit comments

Comments
 (0)