17 Nov
2025
17 Nov
'25
7:55 p.m.
Esme Povirk (@madewokherd) commented about dlls/sane.ds/ui.c:
+ rc = sane_option_get_value( 0, &optcount ); + if (rc != TWCC_SUCCESS) + { + ERR("SANE_LoadOptions: Unable to read number of options\n"); + return; + } + gOptCount = optcount; + + if (RegOpenKeyExA( HKEY_CURRENT_USER, reg_path, 0, KEY_ALL_ACCESS, &h_key)==ERROR_SUCCESS) + { + /* Determine the order in which options shall be set in sane */ + opt_order = malloc((optcount+1) * sizeof(int)); + if (!opt_order) + { + ERR("Out of memory allocation opt_order\n"); + return; This leaks `h_key`.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9479#note_122597