diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-24 16:46:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-25 14:38:11 +0100 |
commit | d803c5e996a06ff5d836bfe992f1a9c6aaf3f1c5 (patch) | |
tree | b78f94171cbec245e823e0e22537a3f8ecd6acb5 /connectivity/source | |
parent | 1fa497e4443b759fded81ae514e8ec70f7d9e5b2 (diff) |
coverity#1202804 Explicit null dereferenced
Change-Id: Iff1ada702f57fba9ba979bc158412b0321921672
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 622809553614..0c477cdc4daf 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1973,9 +1973,11 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition, bool } else { - OSQLParseNode* pNewComparison = NULL; + OSQLParseNode* pNewComparison; switch(pComparison->getNodeType()) { + default: + assert(false && "OSQLParseNode::negateSearchCondition: unexpected node type!"); case SQL_NODE_EQUAL: pNewComparison = new OSQLParseNode(OUString("<>"),SQL_NODE_NOTEQUAL,SQL_NOTEQUAL); break; @@ -1994,10 +1996,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition, bool case SQL_NODE_NOTEQUAL: pNewComparison = new OSQLParseNode(OUString("="),SQL_NODE_EQUAL,SQL_EQUAL); break; - default: - break; } - assert(pNewComparison && "OSQLParseNode::negateSearchCondition: unexpected node type!"); pSearchCondition->replace(pComparison, pNewComparison); delete pComparison; } |