msi: fix missing alloc check.

Lionel_Debroux lionel_debroux at
Sun Dec 9 05:00:55 CST 2007

"msi_dialog_list_box" in dlls/msi/dialog.c gets flagged by Michael
Stefaniuc's script.

* As far as I can see, "info", allocated line 2203, is not used before
the return that leaks it (line 2214), neither in a direct nor an
indirect (macro) way. But maybe the "fail-fast" behaviour is intended
(because if allocation of "info" fails, there are chances the allocation
of "control" would fail, too) ?
* While looking at the source of the functions called by
"msi_dialog_list_box" to make sure they didn't use "info", I spotted a
call to msi_alloc, whose result is not checked. Therefore, the
subsequent lines may write to NULL+some_offset.

The patch contains only the fix for the latter problem, because I'm not
100% sure that the memory leak can be solved by moving the allocation of
info after the call to "msi_dialog_add_control", without ill side
effects (e.g. msi_dialog_add_control calls msi_dialog_create_window,
which calls CreateWindowExW).

2007-12-09  Lionel Debroux <lionel_debroux at>
        * dlls/msi/dialog.c:
        msi: fix missing alloc check.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-msi-fix-missing-alloc-check.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list