Commit a07cff77 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use malloc() to allocate the object attributes buffer.

parent 72fc2cea
...@@ -3596,7 +3596,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU ...@@ -3596,7 +3596,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
*handle = wine_server_ptr_handle( reply->handle ); *handle = wine_server_ptr_handle( reply->handle );
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
RtlFreeAnsiString( &unix_name ); RtlFreeAnsiString( &unix_name );
} }
else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status ); else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
...@@ -3671,7 +3671,7 @@ NTSTATUS WINAPI NtCreateMailslotFile( HANDLE *handle, ULONG access, OBJECT_ATTRI ...@@ -3671,7 +3671,7 @@ NTSTATUS WINAPI NtCreateMailslotFile( HANDLE *handle, ULONG access, OBJECT_ATTRI
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return status; return status;
} }
...@@ -3719,7 +3719,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( HANDLE *handle, ULONG access, OBJECT_ATTR ...@@ -3719,7 +3719,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( HANDLE *handle, ULONG access, OBJECT_ATTR
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return status; return status;
} }
......
...@@ -836,7 +836,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ ...@@ -836,7 +836,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1) if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1)
{ {
status = STATUS_TOO_MANY_OPENED_FILES; status = STATUS_TOO_MANY_OPENED_FILES;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
goto done; goto done;
} }
#ifdef SO_PASSCRED #ifdef SO_PASSCRED
...@@ -873,7 +873,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ ...@@ -873,7 +873,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
process_info = wine_server_ptr_handle( reply->info ); process_info = wine_server_ptr_handle( reply->info );
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
if (status) if (status)
{ {
...@@ -906,7 +906,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ ...@@ -906,7 +906,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
} }
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
if (status) goto done; if (status) goto done;
/* create the child process */ /* create the child process */
......
...@@ -263,8 +263,7 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a ...@@ -263,8 +263,7 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a
len = (len + 3) & ~3; /* DWORD-align the entire structure */ len = (len + 3) & ~3; /* DWORD-align the entire structure */
*ret = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); if (!(*ret = calloc( len, 1 ))) return STATUS_NO_MEMORY;
if (!*ret) return STATUS_NO_MEMORY;
(*ret)->rootdir = wine_server_obj_handle( attr->RootDirectory ); (*ret)->rootdir = wine_server_obj_handle( attr->RootDirectory );
(*ret)->attributes = attr->Attributes; (*ret)->attributes = attr->Attributes;
...@@ -341,7 +340,7 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ ...@@ -341,7 +340,7 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -448,7 +447,7 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ ...@@ -448,7 +447,7 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -601,7 +600,7 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT ...@@ -601,7 +600,7 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -702,7 +701,7 @@ NTSTATUS WINAPI NtCreateJobObject( HANDLE *handle, ACCESS_MASK access, const OBJ ...@@ -702,7 +701,7 @@ NTSTATUS WINAPI NtCreateJobObject( HANDLE *handle, ACCESS_MASK access, const OBJ
*handle = wine_server_ptr_handle( reply->handle ); *handle = wine_server_ptr_handle( reply->handle );
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -937,7 +936,7 @@ NTSTATUS WINAPI NtCreateTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ ...@@ -937,7 +936,7 @@ NTSTATUS WINAPI NtCreateTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -1280,7 +1279,7 @@ NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access, ...@@ -1280,7 +1279,7 @@ NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access,
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
...@@ -1370,7 +1369,7 @@ NTSTATUS WINAPI NtCreateIoCompletion( HANDLE *handle, ACCESS_MASK access, OBJECT ...@@ -1370,7 +1369,7 @@ NTSTATUS WINAPI NtCreateIoCompletion( HANDLE *handle, ACCESS_MASK access, OBJECT
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return status; return status;
} }
...@@ -1583,7 +1582,7 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC ...@@ -1583,7 +1582,7 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return ret; return ret;
} }
......
...@@ -193,7 +193,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT ...@@ -193,7 +193,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
if (server_pipe( request_pipe ) == -1) if (server_pipe( request_pipe ) == -1)
{ {
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
return STATUS_TOO_MANY_OPENED_FILES; return STATUS_TOO_MANY_OPENED_FILES;
} }
server_send_fd( request_pipe[0] ); server_send_fd( request_pipe[0] );
...@@ -216,7 +216,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT ...@@ -216,7 +216,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
} }
SERVER_END_REQ; SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr ); free( objattr );
if (status) if (status)
{ {
close( request_pipe[1] ); close( request_pipe[1] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment