From: "Erich E. Hoover" Subject: [PATCH 1/11] ntdll: Make nt_to_unix_file_name_attr return always safe to free. Message-Id: Date: Mon, 8 Sep 2014 13:41:34 -0600 While working on an upcoming patch set I discovered that several of the file handling primitives are not safe to free under all circumstances. This would not normally be a problem (since a comparison can usually be made against STATUS_SUCCESS). However, there are several cases where this comparison is insufficient (mostly when STATUS_NO_SUCH_FILE occurs). There are two ways to solve this problem: 1) Make these routines always safe to free (and always free them) 2) Specifically add checks for STATUS_NO_SUCH_FILE and free all these cases manually This patch series chooses the first option, both for simplicity and in order to prevent future mistakes arising from these routines. This patch: Make the ANSI string return of nt_to_unix_file_name_attr always safe to free with RtlFreeAnsiString. Needed by patch 4, 5, and 8. From 20a937804583915b42c2264e1b0f2f789c807c1a Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 21 Aug 2014 22:31:53 -0600 Subject: ntdll: Make nt_to_unix_file_name_attr return always safe to free. --- dlls/ntdll/directory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 01998b2..55787eb 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2942,6 +2942,7 @@ NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_STRING * NTSTATUS status; BOOLEAN check_case = !(attr->Attributes & OBJ_CASE_INSENSITIVE); + unix_name_ret->Buffer = NULL; if (!attr->RootDirectory) /* without root dir fall back to normal lookup */ return wine_nt_to_unix_file_name( attr->ObjectName, unix_name_ret, disposition, check_case ); -- 1.7.9.5