summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-10-21 10:03:59 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-21 12:26:39 +0200
commit3d0559e4b8b674cb9a63239b0f28fd23b1dd76bb (patch)
treef9b3478ed579b4aaa618eda2cfd7767197f5ba29 /basic
parentc0dcf426d258bc0b605b4097833729eb9ed05025 (diff)
tdf#120703 (PVS): redundant nullptr check
V668 There is no sense in testing the 'pChan' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Change-Id: I1cb78c27da753525f05de2d3a0b74c894b07528e Reviewed-on: https://gerrit.libreoffice.org/62124 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/io.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx
index 595b0c95bc61..988e56031a3e 100644
--- a/basic/source/comp/io.cxx
+++ b/basic/source/comp/io.cxx
@@ -236,8 +236,6 @@ void SbiParser::Open()
TestToken( AS );
// channel number
std::unique_ptr<SbiExpression> pChan(new SbiExpression( this ));
- if( !pChan )
- Error( ERRCODE_BASIC_SYNTAX );
std::unique_ptr<SbiExpression> pLen;
if( Peek() == SYMBOL )
{
@@ -254,8 +252,7 @@ void SbiParser::Open()
// channel number
// file name
pLen->Gen();
- if( pChan )
- pChan->Gen();
+ pChan->Gen();
aFileName.Gen();
aGen.Gen( SbiOpcode::OPEN_, static_cast<sal_uInt32>(nMode), static_cast<sal_uInt32>(nFlags) );
bInStatement = false;