From c81d00bb513bf5de0fe9a431f83ead5eb9c4d6b7 Mon Sep 17 00:00:00 2001 From: Baudouin Chauviere Date: Thu, 15 Nov 2018 13:55:16 -0700 Subject: [PATCH] Correction of the double free bug --- .../vpr/SRC/fpga_spice/base/fpga_spice_utils.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/vpr7_x2p/vpr/SRC/fpga_spice/base/fpga_spice_utils.c b/vpr7_x2p/vpr/SRC/fpga_spice/base/fpga_spice_utils.c index 4f991b222..4904efe24 100644 --- a/vpr7_x2p/vpr/SRC/fpga_spice/base/fpga_spice_utils.c +++ b/vpr7_x2p/vpr/SRC/fpga_spice/base/fpga_spice_utils.c @@ -183,11 +183,11 @@ int split_path_prog_name(char* prog_path, /* Get the path and prog_name*/ if (-1 == split_pos) { /* In this case, the prog_path actually contains only the program name*/ - path = NULL; - prog_name = local_copy; + path = my_strdup("./"); + prog_name = my_strdup(local_copy); } else if (len == split_pos) { /* In this case the progrom name is NULL... actually the prog_path is a directory*/ - path = local_copy; + path = my_strdup(local_copy); prog_name = NULL; } else { /* We have to split it!*/ @@ -5014,7 +5014,7 @@ add_mux_scff_conf_bits_to_llist(int mux_size, exit(1); } - /* Fill the linked list */ + /* Fill the linked list */ for (ibit = 0; ibit < num_mux_sram_bits; ibit++) { cur_sram_orgz_info->conf_bit_head = add_conf_bit_info_to_llist(cur_sram_orgz_info->conf_bit_head, cur_mem_bit + ibit, @@ -5167,7 +5167,7 @@ add_mux_membank_conf_bits_to_llist(int mux_size, exit(1); } - /* Fill the linked list */ + /* Fill the linked list */ for (ibit = 0; ibit < num_conf_bits; ibit++) { cur_sram_orgz_info->conf_bit_head = add_conf_bit_info_to_llist(cur_sram_orgz_info->conf_bit_head, cur_mem_bit + ibit, @@ -5242,7 +5242,7 @@ add_sram_scff_conf_bits_to_llist(t_sram_orgz_info* cur_sram_orgz_info, sram_bit[ibit]->val = sram_bits[ibit]; } - /* Fill the linked list */ + /* Fill the linked list */ for (ibit = 0; ibit < num_sram_bits; ibit++) { cur_sram_orgz_info->conf_bit_head = add_conf_bit_info_to_llist(cur_sram_orgz_info->conf_bit_head, cur_mem_bit + ibit, @@ -5343,7 +5343,7 @@ void add_sram_membank_conf_bits_to_llist(t_sram_orgz_info* cur_sram_orgz_info, i exit(1); } - /* Fill the linked list */ + /* Fill the linked list */ cur_sram_orgz_info->conf_bit_head = add_conf_bit_info_to_llist(cur_sram_orgz_info->conf_bit_head, mem_index, NULL, bl_bit, wl_bit, @@ -7481,4 +7481,3 @@ void rec_stats_spice_model_global_ports(t_spice_model* cur_spice_model, } -