From b59196e1d7843367a80fb67288949eb4a6c4c463 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 1 Nov 2014 16:18:27 +0000 Subject: coverity#1247614 Unchecked return value Change-Id: I658a7f6c8410cfa38512bb45651e5332fbde3194 --- sot/source/sdstor/ucbstorage.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sot/source') diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index b5c12cdc3c44..6f66c25b7621 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -2835,7 +2835,12 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode } pElement->m_xStream->PrepareCachedForReopen( nMode ); - pElement->m_xStream->Init(); + bool bInited = pElement->m_xStream->Init(); + if (!bInited) + { + SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + return NULL; + } pElement->m_bIsStorage = true; return pElement->m_xStream->CreateStorage(); // can only be created in transacted mode -- cgit