coverity#705871 Dereference before null check

Change-Id: I5e52347ce5cee26dffb4d47fc8d320567a0fea31
This commit is contained in:
Caolán McNamara 2014-05-30 09:27:21 +01:00
parent faf8d79ef6
commit 502f059b1f

View file

@ -83,14 +83,14 @@ bool IteratorPosition::operator== (const IteratorPosition& aPosition) const
//===== Iterator ============================================================== //===== Iterator ==============================================================
Iterator::Iterator (void) Iterator::Iterator()
{ {
mpIterator = NULL; mpIterator = NULL;
} }
Iterator::Iterator (const Iterator& rIterator) Iterator::Iterator (const Iterator& rIterator)
{ {
mpIterator = rIterator.mpIterator->Clone(); mpIterator = rIterator.mpIterator ? rIterator.mpIterator->Clone() : NULL;
} }
Iterator::Iterator (IteratorImplBase* pObject) Iterator::Iterator (IteratorImplBase* pObject)
@ -98,7 +98,7 @@ Iterator::Iterator (IteratorImplBase* pObject)
mpIterator = pObject; mpIterator = pObject;
} }
Iterator::~Iterator (void) Iterator::~Iterator()
{ {
delete mpIterator; delete mpIterator;
} }