]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: fix crash on shutdown
authorSage Weil <sage.weil@dreamhost.com>
Wed, 11 May 2011 04:30:52 +0000 (21:30 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 11 May 2011 04:31:12 +0000 (21:31 -0700)
cur_con may be null on shutdown.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mon/MonClient.cc

index d96e619075feb241920cf4eeb815372ed474bf9a..70e14e9be300764b1f01a8868e8103dfa32b1bba 100644 (file)
@@ -350,8 +350,10 @@ void MonClient::shutdown()
   monc_lock.Lock();
   timer.shutdown();
 
-  cur_con->put();
-  cur_con = NULL;
+  if (cur_con) {
+    cur_con->put();
+    cur_con = NULL;
+  }
 
   monc_lock.Unlock();
 }