regedit: Simplify clean-up in get_lineA/W().

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-05-03 11:28:14 +00:00 committed by Alexandre Julliard
parent a6fc8f6c82
commit 6b596ecf9e
1 changed files with 8 additions and 14 deletions

View File

@ -677,12 +677,7 @@ static char *get_lineA(FILE *fp)
static char *buf, *next;
char *line;
if (!fp)
{
if (size) HeapFree(GetProcessHeap(), 0, buf);
size = 0;
return NULL;
}
if (!fp) goto cleanup;
if (!size)
{
@ -737,7 +732,9 @@ static char *get_lineA(FILE *fp)
}
return line;
}
HeapFree(GetProcessHeap(), 0, buf);
cleanup:
if (size) HeapFree(GetProcessHeap(), 0, buf);
size = 0;
return NULL;
}
@ -788,12 +785,7 @@ static WCHAR *get_lineW(FILE *fp)
static WCHAR *buf, *next;
WCHAR *line;
if (!fp)
{
if (size) HeapFree(GetProcessHeap(), 0, buf);
size = 0;
return NULL;
}
if (!fp) goto cleanup;
if (!size)
{
@ -849,7 +841,9 @@ static WCHAR *get_lineW(FILE *fp)
}
return line;
}
HeapFree( GetProcessHeap(), 0, buf );
cleanup:
if (size) HeapFree(GetProcessHeap(), 0, buf);
size = 0;
return NULL;
}