From c39ee374a775c19d1f48fa7b0e52b52014f92f5d Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Tue, 25 Oct 2016 10:21:32 +0000 Subject: [PATCH] regedit: Close the registry key handle in the read function instead of the parser. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- programs/regedit/regproc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 7f1475eb276..5e4c2d28c43 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -584,15 +584,6 @@ static void processSetValue(WCHAR* line, BOOL is_unicode) */ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode) { - /* - * We encountered the end of the file, make sure we - * close the opened key and exit - */ - if (stdInput == NULL) { - closeKey(); - return; - } - if ( stdInput[0] == '[') /* We are reading a new key */ { WCHAR* keyEnd; @@ -735,7 +726,7 @@ static void processRegLinesA(FILE *in, char* first_chars) line = s_eol + 1; } } - processRegEntry(NULL, FALSE); + closeKey(); HeapFree(GetProcessHeap(), 0, buf); } @@ -851,7 +842,7 @@ static void processRegLinesW(FILE *in) } } - processRegEntry(NULL, TRUE); + closeKey(); HeapFree(GetProcessHeap(), 0, buf); } -- 2.11.4.GIT