On 01/11/2015 10:06 PM, scan-ad...@coverity.com wrote:
Please find the latest report on new defect(s) introduced to Apache-Qpid found
with Coverity Scan.
1 new defect(s) introduced to Apache-Qpid found with Coverity Scan.
7 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent
build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 1262251: Double free (USE_AFTER_FREE)
________________________________________________________________________________________________________
*** CID 1262251: Double free (USE_AFTER_FREE)
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/LossyLvq.h: 34 in
qpid::broker::LossyLvq::~LossyLvq()()
28 namespace broker {
29 class MessageMap;
30
31 /**
32 * Combination of LossyQueue and Lvq behaviours.
33 */
CID 1262251: Double free (USE_AFTER_FREE)
Calling "qpid::broker::LossyQueue::~LossyQueue()" frees pointer
"this->externalQueueStore" which has already been freed.
I think coverity is wrong here. It seems to believe that the destructor
for PersistableQueue will be called twice for the same instance. However
this is not my understanding of the way c++ works or the behaviour I see
in practice.
Lvq and LossyQueue use virtual inheritance when extending the Queue so
the LossyLvq that inherits from each of them will still have one
instance of Queue as its superclass, and the constructor and destructor
of Queue will be called only once.
Am I wrong in any of this? Is there a platform where the destructor for
PersistableQueue is called twice when freeing a given instance of LossyLvq?
34 class LossyLvq : public Lvq, public LossyQueue
35 {
36 public:
37 LossyLvq(const std::string&, std::auto_ptr<MessageMap>, const
QueueSettings&, MessageStore* const, management::Manageable*, Broker*);
38 };
39 }} // namespace qpid::broker
40
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org