Joerg Schad created MESOS-6153:
----------------------------------

             Summary: Resource leak in slave.coo.
                 Key: MESOS-6153
                 URL: https://issues.apache.org/jira/browse/MESOS-6153
             Project: Mesos
          Issue Type: Bug
            Reporter: Joerg Schad
            Assignee: Benjamin Bannier


Coverity detected the following resource leak:
{code}
1. Condition this->queuedTasks.contains(taskId), taking true branch.
6547  if (queuedTasks.contains(taskId)) {
        2. Condition terminal, taking true branch.
6548    if (terminal) {
        3. alloc_fn: Storage is returned from allocation function operator new. 
[Note: The source code implementation of the function has been overridden by a 
builtin model.]
        4. var_assign: Assigning: task = storage returned from new 
mesos::Task(mesos::internal::protobuf::createTask(this->queuedTasks.at(taskId), 
mesos::TaskState const(status->state()), this->frameworkId)).
6549      Task* task = new Task(protobuf::createTask(
6550          queuedTasks.at(taskId),
6551          status.state(),
6552          frameworkId));
6553
6554      queuedTasks.erase(taskId);
6555
6556      // This might be a queued task belonging to a task group.
6557      // If so, we need to update the other tasks belonging to this task 
group.
6558      Option<TaskGroupInfo> taskGroup = getQueuedTaskGroup(taskId);
6559
        5. Condition taskGroup.isSome(), taking true branch.
6560      if (taskGroup.isSome()) {
        6. No elements left in taskGroup->tasks(), leaving loop.
6561        foreach (const TaskInfo& task_, taskGroup->tasks()) {
6562          Task* task = new Task(
6563              protobuf::createTask(task_, status.state(), frameworkId));
6564
6565          tasks.push_back(task);
6566        }
        7. Falling through to end of if statement.
6567      } else {
6568        tasks.push_back(task);
6569      }
        
CID 1372871 (#1 of 1): Resource leak (RESOURCE_LEAK)
8. leaked_storage: Variable task going out of scope leaks the storage it points 
to.
6570    } else {
6571      return Error("Cannot send non-terminal update for queued task");
{code}

https://scan5.coverity.com/reports.htm#v39597/p10429/fileInstanceId=98881751&defectInstanceId=28450463



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to