wscript/tests: Fixed buffer handling and leaks.

This commit is contained in:
Jacek Caban 2015-02-09 13:59:29 +01:00 committed by Alexandre Julliard
parent 7ac8ad4492
commit 748788f33e
1 changed files with 6 additions and 6 deletions

View File

@ -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->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
res = GetFullPathNameA(script_name, sizeof(fullPath)/sizeof(WCHAR), fullPath, &pos); res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, &pos);
if(!res || res > sizeof(fullPath)/sizeof(WCHAR)) if(!res || res > sizeof(fullPath))
return E_FAIL; return E_FAIL;
if(!(V_BSTR(pVarResult) = SysAllocString(a2bstr(pos)))) if(!(V_BSTR(pVarResult) = a2bstr(pos)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
break; 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->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
res = GetFullPathNameA(script_name, sizeof(fullPath)/sizeof(WCHAR), fullPath, NULL); res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, NULL);
if(!res || res > sizeof(fullPath)/sizeof(WCHAR)) if(!res || res > sizeof(fullPath))
return E_FAIL; return E_FAIL;
if(!(V_BSTR(pVarResult) = SysAllocString(a2bstr(fullPath)))) if(!(V_BSTR(pVarResult) = a2bstr(fullPath)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
break; break;
} }