[Libreoffice-commits] core.git: connectivity/source extensions/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 20 06:00:17 UTC 2018


 connectivity/source/drivers/odbc/OStatement.cxx |    3 +--
 extensions/source/scanner/sane.cxx              |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 9d936de849f1d2267dc733d38ff66d66490b04f7
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Oct 19 20:49:19 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 20 07:59:53 2018 +0200

    clang-tidy readability-delete-null-pointer
    
    Change-Id: Ib47fc58f1cdfdd54adff07687c56198aa6f2091e
    Reviewed-on: https://gerrit.libreoffice.org/62029
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index eea0d2d147c2..3a74bf565fe7 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -822,8 +822,7 @@ void OStatement_Base::setFetchSize(sal_Int32 _par0)
     {
         setStmtOption<SQLULEN, SQL_IS_UINTEGER>(SQL_ATTR_ROW_ARRAY_SIZE, _par0);
 
-        if (m_pRowStatusArray)
-            delete[] m_pRowStatusArray;
+        delete[] m_pRowStatusArray;
         m_pRowStatusArray = new SQLUSMALLINT[_par0];
         setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, m_pRowStatusArray);
     }
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 167d6ba97b20..0adeb593d695 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -875,8 +875,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
         p_cancel( maHandle );
         CheckConsistency( "sane_cancel" );
     }
-    if( pBuffer )
-        delete [] pBuffer;
+    delete [] pBuffer;
 
     ReloadOptions();
 


More information about the Libreoffice-commits mailing list