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

Alexandre Julliard julliard at wine.codeweavers.com
Thu May 25 14:18:43 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 0d13a99e799cb4d232027f1e8182856f71a14e45
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=0d13a99e799cb4d232027f1e8182856f71a14e45

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Thu May 25 22:17:46 2006 +0900

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

---

 dlls/msi/msi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 48e726e..53efaee 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -1610,8 +1610,10 @@ UINT WINAPI MsiProvideQualifiedComponent
 
     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;




More information about the wine-cvs mailing list