From 7a7248d952899338e885ca884796a1ee5691b463 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 18 Aug 2015 12:26:44 +0200 Subject: [PATCH] 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 --- src/mon/ConfigKeyService.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mon/ConfigKeyService.cc b/src/mon/ConfigKeyService.cc index ba6408bd938..64ed42ffc88 100644 --- a/src/mon/ConfigKeyService.cc +++ b/src/mon/ConfigKeyService.cc @@ -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(m);