Nikolay Sivov : msi: Fix a leak of allocated string buffer on error path ( Coverity).

Alexandre Julliard julliard at winehq.org
Thu Mar 27 14:40:05 CDT 2014


Module: wine
Branch: master
Commit: c01c0b52ed95a695698c29fae63e42e825cd4172
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c01c0b52ed95a695698c29fae63e42e825cd4172

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Mar 27 06:55:45 2014 +0400

msi: Fix a leak of allocated string buffer on error path (Coverity).

---

 dlls/msi/format.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/format.c b/dlls/msi/format.c
index 756c4d1..3c815d9 100644
--- a/dlls/msi/format.c
+++ b/dlls/msi/format.c
@@ -370,7 +370,11 @@ static LPWSTR build_default_format(const MSIRECORD* record)
         {
             max_len = len;
             buf = msi_realloc(buf, (max_len + 1) * sizeof(WCHAR));
-            if (!buf) return NULL;
+            if (!buf)
+            {
+                msi_free(rc);
+                return NULL;
+            }
         }
 
         if (str)




More information about the wine-cvs mailing list