25 Oct
2022
25 Oct
'22
4:13 p.m.
Piotr Caban (@piotr) commented about dlls/msvcrt/dir.c:
int dir_len = GetCurrentDirectoryA(MAX_PATH,dir);
if (dir_len < 1) - return NULL; /* FIXME: Real return value untested */ + return NULL;
if (!buf) { if (size <= dir_len) size = dir_len + 1; - if (!(buf = malloc( size ))) return NULL; + if (!(buf = malloc( size ))) + { + *_errno() = ENOMEM; + return NULL; + } malloc is already setting errno on failure, there's no need to do it here.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1159#note_12058