MB-20645: Don't request stats from null DCP backfill manager 25/67025/3
authorDave Rigby <daver@couchbase.com>
Wed, 24 Aug 2016 10:54:13 +0000 (11:54 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 25 Aug 2016 08:00:37 +0000 (08:00 +0000)
commitaab7a3319845b64fb75b9d47f0d79b6c4ebeb1aa
tree9cbe094d5a688fd0a7e903e01694b873c943aaef
parent1d9bd1e70d590f6e1b3d8d3b0905e71237312e6c
MB-20645: Don't request stats from null DCP backfill manager

If a DCP Producer has DcpProducer::addStats called on it after its
been disconnected (but before it's removed from the connMap) then we
end up dereferencing a null backfillMgr pointer.

Fix by adding a guard that the manager is valid before including its
stats.

Change-Id: Idc97b447090f5390054a9c40f207dae5494e63b9
Reviewed-on: http://review.couchbase.org/67025
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>
src/dcp/producer.cc
tests/module_tests/dcp_test.cc