Re: wined3d: Fix a memory leak in compile_state_table()
Allan Tong schrieb:
Wrong pointer was being passed to HeapFree.
- Allan
Why did you remove these two lines? Was this your intention? - dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0]; - dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1]; Cheers Rico
2009/1/6 Rico Schüller <kgbricola(a)web.de>:
Allan Tong schrieb:
Wrong pointer was being passed to HeapFree.
- Allan
Why did you remove these two lines? Was this your intention? - dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0]; - dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1];
Because HeapReAlloc() should already take care of any copying, if needed. Using HeapReAlloc() without checking the result first isn't safe of course, but neither was the original code.
On Tue, Jan 6, 2009 at 5:51 AM, Henri Verbeet <hverbeet(a)gmail.com> wrote:
2009/1/6 Rico Schüller <kgbricola(a)web.de>:
Allan Tong schrieb:
Wrong pointer was being passed to HeapFree.
- Allan
Why did you remove these two lines? Was this your intention? - dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0]; - dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1];
Because HeapReAlloc() should already take care of any copying, if needed. Using HeapReAlloc() without checking the result first isn't safe of course, but neither was the original code.
Oops, that was careless of me. I'll send a revised patch. - Allan
participants (3)
-
Allan Tong -
Henri Verbeet -
Rico Schüller