Nikolay Sivov : kernel32/tests: Fix some find handle leaks.

Alexandre Julliard julliard at winehq.org
Mon Dec 21 09:39:52 CST 2009


Module: wine
Branch: master
Commit: f33db8a02d488ce5b310be17237e9a62b2d95e59
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f33db8a02d488ce5b310be17237e9a62b2d95e59

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Mon Dec 21 14:51:08 2009 +0300

kernel32/tests: Fix some find handle leaks.

---

 dlls/kernel32/tests/file.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 90fdee2..56751ae 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -251,7 +251,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA(filename);
     ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError());
@@ -263,7 +265,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should be able to find file\n" );
+    FindClose( find );
 
     ok( 0 == DeleteFileA( filename ), "shouldn't be able to delete a readonly file\n" );
 
@@ -282,7 +286,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should STILL be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should STILL be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA( filename );
     ok( ret, "DeleteFile failed (%d)\n", GetLastError(  ) );
@@ -298,7 +304,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should STILL be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should STILL be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA( filename );
     ok( ret, "DeleteFile failed (%d)\n", GetLastError(  ) );




More information about the wine-cvs mailing list