]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/DaemonServer: avoid dereferencing end() iterator
authorSage Weil <sage@redhat.com>
Mon, 25 Jun 2018 21:00:02 +0000 (16:00 -0500)
committerSage Weil <sage@redhat.com>
Mon, 25 Jun 2018 21:00:02 +0000 (16:00 -0500)
Fixes: http://tracker.ceph.com/issues/23249
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc

index 388b6ca24845e722260c777aeee80d6bc3281605..405a22cdbb8a515844affa7fc095acf74e2c52be 100644 (file)
@@ -1237,8 +1237,7 @@ bool DaemonServer::handle_command(MCommand *m)
                auto p = pg_map.osd_stat.find(osd);
                if (p == pg_map.osd_stat.end()) {
                  missing_stats.insert(osd);
-               }
-               if (p->second.num_pgs > 0) {
+               } else if (p->second.num_pgs > 0) {
                  stored_pgs.insert(osd);
                }
              }