Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


- unopage.cxx and unoshap2.cxx: remove redundant null checks for pointers that 
have already been checked for null value
- odma_datasupplier.cxx: fix memory leak if NODMQueryExecute returns with 
error

Harri
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 4504c99..e4f9abb 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -330,8 +330,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
     if(pObj == NULL)
         return;
 
-    if(pShape)
-        pShape->Create( pObj, this );
+    pShape->Create( pObj, this );
 
     if( mpModel )
         mpModel->SetChanged();
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index b0c48b7..10fd236 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -249,8 +249,7 @@ void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShap
         // Establish connection between new SdrObject and its wrapper before
         // inserting the new shape into the group.  There a new wrapper
         // would be created when this connection would not already exist.
-        if(pShape)
-            pShape->Create( pSdrShape, mxPage.get() );
+        pShape->Create( pSdrShape, mxPage.get() );
 
         if( mpModel )
             mpModel->SetChanged();
diff --git a/ucb/source/ucp/odma/odma_datasupplier.cxx b/ucb/source/ucp/odma/odma_datasupplier.cxx
index 86d1326..8225175 100644
--- a/ucb/source/ucp/odma/odma_datasupplier.cxx
+++ b/ucb/source/ucp/odma/odma_datasupplier.cxx
@@ -288,8 +288,11 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex )
     
     DWORD dwFlags = ODM_SPECIFIC;
     odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId );
-    if(odm != ODM_SUCCESS)
+    if(odm != ODM_SUCCESS) {
+        delete[] pQueryId;
+        delete[] lpszDMSList;
         return sal_False;
+    }
 
     sal_uInt16 nCount          = 10;
     sal_uInt16 nMaxCount       = 10;

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.