From f634fe15db1d6f09615505eb445b9e748720dbeb Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Sun, 15 Jul 2018 23:15:26 +0100 Subject: [PATCH] cmd: Fix handle leak in if exists. Fixes regression in f53d57c8549dc439eb73354bfd37acd1e4e86cfd. Signed-off-by: Jason Edmeades Signed-off-by: Alexandre Julliard --- programs/cmd/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 57a41c47523..ff58484b9ad 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2844,7 +2844,7 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) WIN32_FIND_DATAW fd; HANDLE hff = FindFirstFileW(WCMD_parameter(p, 1+negate, NULL, FALSE, FALSE), &fd); test = (hff != INVALID_HANDLE_VALUE ); - if (!test) FindClose(hff); + if (test) FindClose(hff); WCMD_parameter(p, 2+negate, &command, FALSE, FALSE); }