diff --git a/platform/src/key_keeper.cpp b/platform/src/key_keeper.cpp index ec72591..8804c27 100644 --- a/platform/src/key_keeper.cpp +++ b/platform/src/key_keeper.cpp @@ -345,11 +345,11 @@ static struct keyring_private* get_keyring_from_response(const char* data) X509_free(cert); EVP_PKEY_free(key); sk_X509_pop_free(chain, X509_free); - cJSON_free(data_json); + cJSON_Delete(data_json); return _kyr; error_out: - if(data_json!=NULL) cJSON_free(data_json); + if(data_json!=NULL) cJSON_Delete(data_json); if(cert) X509_free(cert); if(key) EVP_PKEY_free(key); if(chain) sk_X509_pop_free(chain, X509_free); diff --git a/platform/src/tcp_stream.cpp b/platform/src/tcp_stream.cpp index 247d579..255f4b9 100644 --- a/platform/src/tcp_stream.cpp +++ b/platform/src/tcp_stream.cpp @@ -841,12 +841,12 @@ void tfe_stream_destory(struct tfe_stream_private * stream) if (stream->head.addr) { - free(stream->head.addr); + FREE(&(stream->head.addr)); } if (stream->str_stream_addr) { - free(stream->str_stream_addr); + FREE(&(stream->str_stream_addr)); } if (__is_ssl(stream) && stream->ssl_upstream) @@ -890,9 +890,9 @@ void tfe_stream_destory(struct tfe_stream_private * stream) { future_destroy(stream->future_upstream_create); } - + FREE(&(stream->plugin_ctxs)); stream->proxy_ref = NULL; - free(stream); + FREE(&(stream)); thread->load--; } diff --git a/plugin/business/pangu-http/src/pangu_logger.cpp b/plugin/business/pangu-http/src/pangu_logger.cpp index 1bb753f..4b60fa1 100644 --- a/plugin/business/pangu-http/src/pangu_logger.cpp +++ b/plugin/business/pangu-http/src/pangu_logger.cpp @@ -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; }