May 29, 2026
4:47 p.m.
On Fri May 29 16:38:54 2026 +0000, Vibhav Pant wrote:
I think it would be much simpler to let the old code stay, and just add `free(data)` under `failed`. `free(NULL)` is guaranteed to do nothing. I thought about doing that, then realized that if we wait to initialize `data` until it is actually needed then `free(data)` only needs to be called in the last error case and not in every error case. In my opinion that makes the code more clear. But either way, initializing `data` to `NULL` is redundant because `data = malloc(sizeof(*data))` is always run before `free(data)` is called.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10931#note_141724