Hi Andrew,
Andrew Nguyen wrote:
This revision incorporates Jacek Caban's suggestions.
dlls/jscript/string.c | 55 +++++++++++++++++++++++++++++++++++++++++++- dlls/jscript/tests/api.js | 17 ++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-)
+ if(ret) { + sprintfW(ret, attrtagfmtW, tagname, attrname, (attrval ? attrval : undefinedW), string->str, tagname); + + V_VT(retv) = VT_BSTR; + V_BSTR(retv) = ret; + + SysFreeString(attrval);
It looks for me much better now, but you leak attrval if retv is NULL or SysAllocStringLen fails. SysFreeString call should be moved just before the last return.
Jacek