diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-04 23:01:17 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-04 23:01:17 +0400 |
commit | 9b94d385f94562049bf93f2fc0dd0558d6a56dd1 (patch) | |
tree | 94f99d981695301f17c78e0d097a562162cfae13 /basic | |
parent | be35cbe0d86b416414972754af7dfef9c21bc3b0 (diff) |
cppcheck: avoid possible null pointer dereferences
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/exprtree.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 1c7ec1be4767..41caa05a276c 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -983,8 +983,14 @@ SbiExpression* SbiExprList::Get( short n ) void SbiExprList::addExpression( SbiExpression* pExpr ) { + if( !pFirst ) + { + pFirst = pExpr; + return; + } + SbiExpression* p = pFirst; - while( p && p->pNext ) + while( p->pNext ) p = p->pNext; p->pNext = pExpr; |