[PATCH 07/10] opcservices: Improve error handling (Coverity).
Nikolay Sivov
nsivov at codeweavers.com
Wed Sep 19 06:19:35 CDT 2018
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/opcservices/package.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c
index fab337d6f5..c865cf35ad 100644
--- a/dlls/opcservices/package.c
+++ b/dlls/opcservices/package.c
@@ -1476,9 +1476,9 @@ static HRESULT opc_package_write_contenttypes(struct zip_archive *archive, IXmlW
if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, &content)))
return hr;
- IXmlWriter_SetOutput(writer, (IUnknown *)content);
-
- hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
+ hr = IXmlWriter_SetOutput(writer, (IUnknown *)content);
+ if (SUCCEEDED(hr))
+ hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
if (SUCCEEDED(hr))
hr = IXmlWriter_WriteStartElement(writer, NULL, typesW, uriW);
if (SUCCEEDED(hr))
@@ -1566,9 +1566,9 @@ static HRESULT opc_package_write_rels(struct zip_archive *archive, IOpcRelations
return hr;
}
- IXmlWriter_SetOutput(writer, (IUnknown *)content);
-
- hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
+ hr = IXmlWriter_SetOutput(writer, (IUnknown *)content);
+ if (SUCCEEDED(hr))
+ hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
if (SUCCEEDED(hr))
hr = IXmlWriter_WriteStartElement(writer, NULL, relationshipsW, uriW);
--
2.18.0
More information about the wine-devel
mailing list