Skip to content

Commit

Permalink
Fix memory leak in contrail-collector when kafka down
Browse files Browse the repository at this point in the history
When kafka down, contrail-collecor can receive event. To detect if
kafka start again, contrail-collector need call librdkafka api to
detect metadata, the metada is a pointer, librdkafka will malloc
memory for metadata, and need caller to free it.

Change-Id: I84698de36f57ece17ea3776b2ef99b5154ddd2ff
Closes-bug: 1770123
  • Loading branch information
ZhiqiangCui committed May 22, 2018
1 parent 6edaa55 commit 1b51d98
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrail-collector/kafka_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ KafkaProcessor::KafkaTimer() {
k_event_cb.disableKafka = false;
}
}
LOG(DEBUG, "Deleting metadata !!!");
delete metadata;
}
}

Expand Down

0 comments on commit 1b51d98

Please sign in to comment.