Module: wine Branch: master Commit: 748788f33e228b98ea1616cbc5af1d84d5db4a19 URL: http://source.winehq.org/git/wine.git/?a=commit;h=748788f33e228b98ea1616cbc5...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Feb 9 13:59:29 2015 +0100
wscript/tests: Fixed buffer handling and leaks.
---
programs/wscript/tests/run.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/programs/wscript/tests/run.c b/programs/wscript/tests/run.c index e74e3d8..e0a6932 100644 --- a/programs/wscript/tests/run.c +++ b/programs/wscript/tests/run.c @@ -254,10 +254,10 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs); ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); V_VT(pVarResult) = VT_BSTR; - res = GetFullPathNameA(script_name, sizeof(fullPath)/sizeof(WCHAR), fullPath, &pos); - if(!res || res > sizeof(fullPath)/sizeof(WCHAR)) + res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, &pos); + if(!res || res > sizeof(fullPath)) return E_FAIL; - if(!(V_BSTR(pVarResult) = SysAllocString(a2bstr(pos)))) + if(!(V_BSTR(pVarResult) = a2bstr(pos))) return E_OUTOFMEMORY; break; } @@ -270,10 +270,10 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs); ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); V_VT(pVarResult) = VT_BSTR; - res = GetFullPathNameA(script_name, sizeof(fullPath)/sizeof(WCHAR), fullPath, NULL); - if(!res || res > sizeof(fullPath)/sizeof(WCHAR)) + res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, NULL); + if(!res || res > sizeof(fullPath)) return E_FAIL; - if(!(V_BSTR(pVarResult) = SysAllocString(a2bstr(fullPath)))) + if(!(V_BSTR(pVarResult) = a2bstr(fullPath))) return E_OUTOFMEMORY; break; }