msi: Translate the resulting string only if the previous call succeeded.

This commit is contained in:
Dmitry Timoshkov 2006-05-25 22:17:46 +09:00 committed by Alexandre Julliard
parent bcd6e9f33b
commit 0d13a99e79
1 changed files with 4 additions and 2 deletions

View File

@ -1610,8 +1610,10 @@ UINT WINAPI MsiProvideQualifiedComponentA( LPCSTR szComponent,
msi_free(szwComponent);
msi_free(szwQualifier);
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, pcchwPathBuf,
lpPathBuf, *pcchPathBuf, NULL, NULL);
if (rc == ERROR_SUCCESS)
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, pcchwPathBuf,
lpPathBuf, *pcchPathBuf, NULL, NULL);
msi_free(lpwPathBuf);
return rc;