Author: kpvdr
Date: 2010-06-04 13:37:23 -0400 (Fri, 04 Jun 2010)
New Revision: 4008
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/jdir.cpp
Log:
Fixes for various Coverity-indicated problems: 11689(MessageStoreImpl.cpp),
11691(jdir.cpp) and 11688(JournalImpl.cpp).
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2010-06-04 15:05:39 UTC (rev 4007)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2010-06-04 17:37:23 UTC (rev 4008)
@@ -498,7 +498,9 @@
void
JournalImpl::stop(bool block_till_aio_cmpl)
{
-
(dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get()))->cancel();
+ InactivityFireEvent* ifep =
dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get());
+ assert(ifep); // dynamic_cast can return null if the cast fails
+ ifep->cancel();
jcntl::stop(block_till_aio_cmpl);
if (_mgmtObject != 0) {
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-06-04 15:05:39 UTC (rev 4007)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-06-04 17:37:23 UTC (rev 4008)
@@ -193,8 +193,7 @@
<< JRNL_MAX_NUM_FILES << "); changing this parameter to
maximum value.");
return;
}
- u_int16_t q = opts->autoJrnlExpandMaxFiles;
- if (q && q == defAutoJrnlExpandMaxFiles && numJrnlFiles !=
defTplNumJrnlFiles) {
+ if (p && p == defAutoJrnlExpandMaxFiles && numJrnlFiles !=
defTplNumJrnlFiles) {
// num-jfiles is different from the default AND max-auto-expand-jfiles is still
at default
// change value of max-auto-expand-jfiles
autoJrnlExpand = true;
@@ -1327,10 +1326,10 @@
}
}
} else {
- THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
": store() failed: queue NULL.");
+ THROW_STORE_EXCEPTION(std::string("MessageStoreImpl::store() failed:
queue NULL."));
}
} catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
": store() failed: " +
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
": MessageStoreImpl::store() failed: " +
e.what());
}
}
Modified: store/trunk/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jdir.cpp 2010-06-04 15:05:39 UTC (rev 4007)
+++ store/trunk/cpp/lib/jrnl/jdir.cpp 2010-06-04 17:37:23 UTC (rev 4008)
@@ -202,6 +202,7 @@
break;
}
}
+ close_dir(dir, dirname, "push_down");
return bak_dir_name;
}
Show replies by date