Marcus Meissner : oledb32: Avoid leaking propsets on error paths (Coverity) .

Alexandre Julliard julliard at winehq.org
Mon Jan 7 13:42:20 CST 2013


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

Author: Marcus Meissner <meissner at suse.de>
Date:   Sat Jan  5 13:14:08 2013 +0100

oledb32: Avoid leaking propsets on error paths (Coverity).

---

 dlls/oledb32/datainit.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c
index c710367..a870bbc 100644
--- a/dlls/oledb32/datainit.c
+++ b/dlls/oledb32/datainit.c
@@ -293,11 +293,10 @@ static HRESULT set_dbpropset(BSTR name, BSTR value, DBPROPSET **propset)
 {
     static const WCHAR datasourceW[] = {'D','a','t','a',' ','S','o','u','r','c','e',0};
 
-    *propset = CoTaskMemAlloc(sizeof(DBPROPSET));
-    (*propset)->rgProperties = CoTaskMemAlloc(sizeof(DBPROP));
-
     if (!strcmpW(datasourceW, name))
     {
+        *propset = CoTaskMemAlloc(sizeof(DBPROPSET));
+        (*propset)->rgProperties = CoTaskMemAlloc(sizeof(DBPROP));
         (*propset)->cProperties = 1;
         (*propset)->guidPropertySet = DBPROPSET_DBINIT;
         (*propset)->rgProperties[0].dwPropertyID = DBPROP_INIT_DATASOURCE;
@@ -310,6 +309,7 @@ static HRESULT set_dbpropset(BSTR name, BSTR value, DBPROPSET **propset)
     }
     else
     {
+        *propset = NULL;
         FIXME("unsupported property %s\n", debugstr_w(name));
         return E_FAIL;
     }




More information about the wine-cvs mailing list