Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kafka/consumer_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ new_consumer_msg(rd_kafka_message_t *rd_message) {
msg = malloc(sizeof(msg_t));
msg->topic = rd_message->rkt;
msg->partition = rd_message->partition;
msg->value = NULL;
msg->value_len = 0;
msg->key = NULL;
msg->key_len = 0;
msg->offset = 0;
Comment on lines +125 to +129
Copy link

@olegrok olegrok Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was worth to change malloc to calloc instead clear every field manually


// value
if (rd_message->len > 0) {
Expand Down Expand Up @@ -159,4 +164,4 @@ destroy_consumer_msg(msg_t *msg) {
free(msg);

return;
}
}