From 8bb7027393ce6c0a86deb8e052cb83c7d449fbb6 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 21 Dec 2018 22:59:28 +0000 Subject: [PATCH] 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 --- src/options.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/options.c b/src/options.c index 93b6415..183160d 100644 --- a/src/options.c +++ b/src/options.c @@ -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");