CID 731938 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (15): Passing null pointer "f" to function "ceph::Formatter::dump_int(char const *, int64_t)", which dereferences it. (The dereference happens because this is a virtual function call.)
Signed-off-by: Sage Weil <sage@inktank.com>
for (int k=s-1; k>=0; k--) {
int item = crush->get_bucket_item(cur, k);
q.push_front(qi(item, depth+1, (float)crush->get_bucket_item_weight(cur, k) / (float)0x10000));
- f->dump_int("child", item);
+ if (f)
+ f->dump_int("child", item);
}
if (f)
f->close_section();