tfe stream destroy未释放plugin ctx;cJSON结构体错误的使用cjsonfree释放,正确做法是cjson delete。

This commit is contained in:
zhengchao
2018-11-29 17:11:31 +08:00
parent 0e47b8d715
commit cc5420d158
3 changed files with 8 additions and 8 deletions

View File

@@ -230,7 +230,7 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
kafka_status = rd_kafka_produce(handle->kafka_topic, RD_KAFKA_PARTITION_UA, RD_KAFKA_MSG_F_COPY,
log_payload, strlen(log_payload), NULL, 0, NULL);
free(log_payload);
cJSON_free(per_hit_obj);
cJSON_Delete(per_hit_obj);
if(kafka_status<0)
{
TFE_LOG_ERROR(handle->local_logger, "Kafka produce failed: %s", rd_kafka_err2name(rd_kafka_last_error()));
@@ -238,6 +238,6 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
send_cnt++;
}
cJSON_free(common_obj);
cJSON_Delete(common_obj);
return send_cnt;
}