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:
Yuxuan Shui 2018-12-21 22:59:28 +00:00
parent 7915ade1be
commit 8bb7027393
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 1 additions and 0 deletions

View File

@ -722,6 +722,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
break;
case 305:
// --shadow-exclude-reg
free(opt->shadow_exclude_reg_str);
opt->shadow_exclude_reg_str = strdup(optarg);
log_warn("--shadow-exclude-reg is deprecated. You are likely "
"better off using --shadow-exclude anyway");