Fix memory leak in get_cfg
When setting --shadow-exclude-reg from both the config file and the command line, one of the strings is not freed. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
		| @ -722,6 +722,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, | |||||||
| 			break; | 			break; | ||||||
| 		case 305: | 		case 305: | ||||||
| 			// --shadow-exclude-reg | 			// --shadow-exclude-reg | ||||||
|  | 			free(opt->shadow_exclude_reg_str); | ||||||
| 			opt->shadow_exclude_reg_str = strdup(optarg); | 			opt->shadow_exclude_reg_str = strdup(optarg); | ||||||
| 			log_warn("--shadow-exclude-reg is deprecated. You are likely " | 			log_warn("--shadow-exclude-reg is deprecated. You are likely " | ||||||
| 			         "better off using --shadow-exclude anyway"); | 			         "better off using --shadow-exclude anyway"); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Yuxuan Shui
					Yuxuan Shui