Skip to content

Commit

Permalink
Merge "Fixing memory leak when kafka producer is not present. Closes-…
Browse files Browse the repository at this point in the history
…Bug:1586189" into R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 30, 2016
2 parents 6e81436 + 7f9f1d6 commit 95cbc11
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/analytics/OpServerProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,17 @@ class OpServerProxy::OpServerImpl {
LOG(ERROR, "Kafka ignoring KafkaPub");
return;
}
char* gn = new char[gen.length()+1];
strcpy(gn,gen.c_str());

if (producer_) {
char* gn = new char[gen.length()+1];
strcpy(gn,gen.c_str());

// Key in Kafka Topic includes UVE Key, Type
producer_->produce(topic_[pt].get(), 0,
RdKafka::Producer::MSG_COPY,
const_cast<char *>(value.c_str()), value.length(),
&skey, (void *)gn);
}
}
}

struct RedisInfo {
Expand Down

0 comments on commit 95cbc11

Please sign in to comment.