From 30cffa0653f7260618c5f8a3b56641e099b59c9a Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 2 Aug 2016 15:02:49 +0800 Subject: [PATCH] osd: initialize class_handler of OSD properly The destructor of OSD will delete class_handler arbitrarily and there are cases we'll fail to start an osd before we load the class_handler correctly. So it is safe to initialize class_handler to NULL as to avoid access violation. Signed-off-by: xie xingguo --- src/osd/OSD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 325c845e34adf..65c4b3555af55 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1234,7 +1234,7 @@ protected: bool asok_command(string command, cmdmap_t& cmdmap, string format, ostream& ss); public: - ClassHandler *class_handler; + ClassHandler *class_handler = nullptr; int get_nodeid() { return whoami; } static ghobject_t get_osdmap_pobject_name(epoch_t epoch) { -- 2.39.5