I sent the complete patch (including the SDL parts) to MAMEdev and also posted about the issue on the MESSdev mailing list before I started working on it to get feedback on that issue. I also described what I did and why I did it. The patch didn't make u3, but so did nothing I sent to MAMEdev after u2. So I have no idea, if the changes were rejected or else. From people, that are on the list I heard, that there was concern about some of my changes and there's a backlog post-u2 changes and there's work being done to get those in, but also requests to submit it again. Since I am not sure what actually made it and lack of time I decided for u4.
To clear up the comment by Lord Nightmare. The patch was neither incomplete nor partial, but I might have overseen some memory leaks in the code (only possible to say with further code reviews or memory leak detection tools - static and/or run-time). The code is question is part of the OSD layer and exists in Windows and SDL, so I had to touch both. In both cases it's a change from one malloc variant to another (standard malloc() to osd_malloc()) and the fixing of the free calls (which were in most cases totally wrong and caused memory leaks all over the place - not just with newui/wimgtool, but the core as well).
The crash is newui happened because I accidentally committed code, that was from my patched tree, which needs osd_free() to be used. The fix would just have been to use global_free() instead (just for consistency since it does *nothing* to just malloc'd memory), but since it causes link problems with some tools there has to be an intentional memory leak for now. I will apply the patch later since I ran into a memory leak (in my non-fixed tree) when checking the fix.