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

This commit is contained in:
Marcus Meissner 2013-01-05 13:14:08 +01:00 committed by Alexandre Julliard
parent 3a29e87673
commit 18c51a9c00
1 changed files with 3 additions and 3 deletions

View File

@ -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}; 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)) if (!strcmpW(datasourceW, name))
{ {
*propset = CoTaskMemAlloc(sizeof(DBPROPSET));
(*propset)->rgProperties = CoTaskMemAlloc(sizeof(DBPROP));
(*propset)->cProperties = 1; (*propset)->cProperties = 1;
(*propset)->guidPropertySet = DBPROPSET_DBINIT; (*propset)->guidPropertySet = DBPROPSET_DBINIT;
(*propset)->rgProperties[0].dwPropertyID = DBPROP_INIT_DATASOURCE; (*propset)->rgProperties[0].dwPropertyID = DBPROP_INIT_DATASOURCE;
@ -310,6 +309,7 @@ static HRESULT set_dbpropset(BSTR name, BSTR value, DBPROPSET **propset)
} }
else else
{ {
*propset = NULL;
FIXME("unsupported property %s\n", debugstr_w(name)); FIXME("unsupported property %s\n", debugstr_w(name));
return E_FAIL; return E_FAIL;
} }