6 Oct
2024
6 Oct
'24
6:20 p.m.
Clang is reporting that `alloc_console` in `dlls/kernelbase/console.c` is improperly holding `&console_section`. It's likely referencing[ this line](https://gitlab.winehq.org/wine/wine/-/blob/7ee99608f469723bafadb28ef0ebd2063...), where the function returns FALSE on an allocation failure without leaving `console_section`. Rewriting the code to ``` if (!(console_si.lpAttributeList = HeapAlloc( GetProcessHeap(), 0, size ))) { RtlLeaveCriticalSection( &console_section ); return FALSE; } ``` fixes the warning. Is this intended, and clang is just displaying a false positive? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6623#note_84131