summaryrefslogtreecommitdiff
path: root/benchmark/src/sapp_benchmark_utils.cpp
diff options
context:
space:
mode:
authoryangwei <[email protected]>2023-07-28 23:40:07 +0800
committeryangwei <[email protected]>2023-08-02 18:22:12 +0800
commit44f4cabef1fd40969e6b874c8d99d0acdf79895a (patch)
treea91fc1a4217b7727a13af1e6095e3d73b1b2314d /benchmark/src/sapp_benchmark_utils.cpp
parent840c58a1efeed8f5cb7959ac7a110bbf3c2421e7 (diff)
🐞 fix(cmd args mem free): 修复-c参数申请的内存,退出时未释放的bug
Diffstat (limited to 'benchmark/src/sapp_benchmark_utils.cpp')
-rw-r--r--benchmark/src/sapp_benchmark_utils.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/benchmark/src/sapp_benchmark_utils.cpp b/benchmark/src/sapp_benchmark_utils.cpp
index b3347dd..ca17965 100644
--- a/benchmark/src/sapp_benchmark_utils.cpp
+++ b/benchmark/src/sapp_benchmark_utils.cpp
@@ -202,7 +202,7 @@ static int tuntap_dev_create(char *dev, int flags)
*/
int sapp_bchmk_create_process_engine(benchmark_engine_t *bch_engine)
{
- int ret, opt_len;
+ int ret;
char tmp_str[CONFIG_MAX_LEN];
char tap_dev_name_up[TAP_DEV_NAME_MAX_LEN];
char tap_dev_name_down[TAP_DEV_NAME_MAX_LEN];
@@ -364,7 +364,6 @@ static const pcap_file_hdr_t g_pcap_file_hdr =
int sapp_bchmk_gen_pcap_header(benchmark_engine_t *bchmk_engine, const char *pcap_filename)
{
FILE *fp;
- int i;
pcap_pkt_hdr_t pcap_pkt_hdr = {};
struct timeval cur_time;
@@ -549,11 +548,7 @@ const char *sapp_bchmk_need_check_forward_pkt(benchmark_engine_t *bchmk_engine,
const cJSON *sapp_bchmk_need_check_inject_pkt(benchmark_engine_t *bchmk_engine, int carray_pkt_index)
{
const cJSON *cJSON_inject_root;
- const cJSON *sub_pkt_detail_item;
- const cJSON *sub_array_item;
const cJSON *sub_array_pkt_index_item;
- const cJSON *sub_array_pkt_json_file_item;
- int i, array_size;
cJSON_inject_root = cJSON_GetObjectItem(bchmk_engine->benchmark_json_struct, "inject");
if(NULL == cJSON_inject_root){
@@ -586,7 +581,6 @@ const cJSON *sapp_bchmk_need_process_control(benchmark_engine_t *bchmk_engine, i
{
const cJSON *cJSON_control_root;
const cJSON *sub_cjson_delay_root;
- int i, array_size;
cJSON_control_root = cJSON_GetObjectItem(bchmk_engine->benchmark_json_struct, "control");
if(NULL == cJSON_control_root){