Skip to content

LookUpVertexIndexProcessor double free #1853

Closed
@wadeliuyi

Description

in function LookUpVertexIndexProcessor step 3:

std::for_each(req.get_parts().begin(), req.get_parts().end(), [&](auto& partId) {
        auto code = executeExecutionPlan(partId);
        if (code != kvstore::ResultCode::SUCCEEDED) {
            VLOG(1) << "Error! ret = " << static_cast<int32_t>(code)
                    << ", spaceId = " << spaceId_
                    << ", partId =  " << partId;
            if (code == kvstore::ResultCode::ERR_LEADER_CHANGED) {
                this->handleLeaderChanged(spaceId_, partId);
            } else {
                this->pushResultCode(this->to(code), partId);
            }
            this->onFinished();
            return;
        }
    });

this->onFinished() will delete this pointer, but the "return" just return from the lambda, so the function will excute go on to the end and call this->onFinished() again.

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions