ConfigKeyService.cc: move assert before first deref

Fix for:

[src/mon/ConfigKeyService.cc:94] -> [src/mon/ConfigKeyService.cc:100]:
 (warning) Possible null pointer dereference: m - otherwise it is redundant
 to check it against null.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2015-08-18 12:26:44 +02:00
parent 742feec7bc
commit 7a7248d952

View File

@ -91,13 +91,14 @@ void ConfigKeyService::store_list(stringstream &ss)
bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
{
Message *m = op->get_req();
assert(m != NULL);
dout(10) << __func__ << " " << *m << dendl;
if (!in_quorum()) {
dout(1) << __func__ << " not in quorum -- ignore message" << dendl;
return false;
}
assert(m != NULL);
assert(m->get_type() == MSG_MON_COMMAND);
MMonCommand *cmd = static_cast<MMonCommand*>(m);