Thank you. I'm sorry for the mistakes I've made. As this patch still needs improving, maybe mark 104193, 104110, 103576 as rejected? 2014-04-26 20:44 GMT+08:00 Jacek Caban <jacek(a)codeweavers.com>:
Hi Zhenbo,
This is better, but:
On 04/26/14 05:12, Zhenbo Li wrote:
+ hres = var2str(&v, &val); + + if (hres != S_OK){ + ERR("Set Width(%s) failed when initializing a nsAString!\n", + debugstr_variant(&v)); + nsAString_Finish(&val);
Again, this is not initialized in the error case.
As I've added
+ default: + nsAString_Init(nsstr, NULL); + FIXME("unsupported arg %s\n", debugstr_variant(p)); + return E_NOTIMPL; + } Isn't it enough?
Or you mean here?
+ ret = nsAString_Init(nsstr, str); + SysFreeString(str); + return ret ? S_OK : E_OUTOFMEMORY; Should I free a string which failed when initializing due to out-of-memory?
+ + hres = nsstr_to_truncated_bstr(&val, &bstr); + if (FAILED(hres)) { + SysFreeString(bstr);
And bstr is not initialized in error case.
The error case comes from
+ ret = end ? SysAllocStringLen(str, end-str) : SysAllocString(str); + if(!ret) + return E_OUTOFMEMORY; I have the same question.
Also, as Dmitry pointed, you don't check for some errors in var2str.
This is my fault, I'll fix it then. Thanks Dmitry, too
Jacek
-- Have a nice day! Zhenbo Li