[PATCH 0/2] MR6171: odbc32: In get_drivers fix error path and In simplify loop condition
They will always be true, since we exit the loop manually if they are not -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6171
From: Fabian Maurer <dark.shadow4(a)web.de> --- dlls/odbc32/unixlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c index 550a0681a9f..64632e29b61 100644 --- a/dlls/odbc32/unixlib.c +++ b/dlls/odbc32/unixlib.c @@ -254,7 +254,7 @@ static void get_drivers( struct drivers *drivers ) capacity = 4; if (!(names = malloc( capacity * sizeof(*names) ))) goto done; info_max_size = offsetof(KEY_VALUE_BASIC_INFORMATION, Name) + 512; - if (!(info = malloc( info_max_size ))) goto done; + if (!(info = malloc( info_max_size ))) goto error; while (!status && info) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6171
From: Fabian Maurer <dark.shadow4(a)web.de> They will always be true, since we exit the loop manually if they are not --- dlls/odbc32/unixlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c index 64632e29b61..dace2c30c99 100644 --- a/dlls/odbc32/unixlib.c +++ b/dlls/odbc32/unixlib.c @@ -256,7 +256,7 @@ static void get_drivers( struct drivers *drivers ) info_max_size = offsetof(KEY_VALUE_BASIC_INFORMATION, Name) + 512; if (!(info = malloc( info_max_size ))) goto error; - while (!status && info) + while (1) { status = NtEnumerateValueKey( key, idx, KeyValueBasicInformation, info, info_max_size, &info_size ); while (status == STATUS_BUFFER_OVERFLOW) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6171
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6171
participants (3)
-
Fabian Maurer -
Fabian Maurer (@DarkShadow44) -
Hans Leidekker (@hans)