Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
fix potential null pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
CatKang committed Jan 18, 2018
1 parent 2474a40 commit a72d3ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node/zp_binlog_sender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,16 @@ Status ZPBinlogSendTaskPool::AddNewTask(const std::string &table_name,
RemoveTask(task_ptr->name());
}
s = AddTask(task_ptr);
if (!s.ok()) {
delete task_ptr;
}
LOG(INFO) << "Add BinlogTask for Table:" << task_ptr->name()
<< ", partition: " << task_ptr->partition_id()
<< ", target: " << task_ptr->node()
<< ", sequence: " << task_ptr->sequence()
<< ", filenum: " << task_ptr->filenum()
<< ", ioffset: " << task_ptr->offset()
<< ", result: " << s.ToString();
if (!s.ok()) {
delete task_ptr;
}
return s;
}

Expand Down

0 comments on commit a72d3ce

Please sign in to comment.