From 2fbe8d23eb2070472d75037ac8024bd9e2509bfb Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead@gmail.com>
Date: Sat, 24 Jan 2009 18:47:33 +0300
Subject: [PATCH] msi: Fix potential NULL pointer dereference in
 ILockBytes_Release (Coverity).

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

diff --git a/dlls/msi/storages.c b/dlls/msi/storages.c
index 2e21cb87bba..302906b8466 100644
--- a/dlls/msi/storages.c
+++ b/dlls/msi/storages.c
@@ -134,7 +134,7 @@ static UINT STORAGES_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec
 
 static HRESULT stream_to_storage(IStream *stm, IStorage **stg)
 {
-    ILockBytes *lockbytes;
+    ILockBytes *lockbytes = NULL;
     STATSTG stat;
     LPVOID data;
     HRESULT hr;
@@ -177,7 +177,7 @@ static HRESULT stream_to_storage(IStream *stm, IStorage **stg)
 
 done:
     msi_free(data);
-    ILockBytes_Release(lockbytes);
+    if (lockbytes) ILockBytes_Release(lockbytes);
     return hr;
 }
 
-- 
GitLab