Signed-off-by: Sven Baars sbaars@codeweavers.com --- dlls/ntdll/unix/env.c | 2 +- dlls/ntdll/unix/file.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index fc5c462e04f..3ac1ed9ab63 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -912,7 +912,7 @@ static void rebuild_argv(void) */ static void prepend_argv( const char **args, int count ) { - char **new_argv = malloc( (main_argc + count) * sizeof(*new_argv) ); + char **new_argv; char *p, *end; BOOL write_strings = FALSE; int i, total = 0, new_argc = main_argc + count - 1; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 2f18325fb90..c033bb06fa3 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3298,7 +3298,12 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
/* check if prefix exists (except for DOS drives to avoid extra stat calls) */
- if (wcschr( prefix, '/' )) return STATUS_OBJECT_PATH_NOT_FOUND; + if (wcschr( prefix, '/' )) + { + free( unix_name ); + return STATUS_OBJECT_PATH_NOT_FOUND; + } + if (prefix_len != 2 || prefix[1] != ':') { unix_name[pos] = 0;
Signed-off-by: Sven Baars sbaars@codeweavers.com --- dlls/ntdll/tests/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index d469b449a74..b7b46365911 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2319,7 +2319,7 @@ static void test_file_link_information(void) "Link did not change casing on existing target file: got %s\n", wine_dbgstr_w(find_data.cFileName)); }
- CloseHandle( handle ); + FindClose( handle ); HeapFree( GetProcessHeap(), 0, fli ); delete_object( oldpath ); delete_object( newpath ); @@ -2904,7 +2904,7 @@ static void test_file_link_information(void) "Link did not change casing on same file: got %s\n", wine_dbgstr_w(find_data.cFileName)); }
- CloseHandle( handle ); + FindClose( handle ); HeapFree( GetProcessHeap(), 0, fli ); delete_object( oldpath ); }