From a727596faaa91a4459daad4cc5a6618c20ce6475 Mon Sep 17 00:00:00 2001 From: babarosaM33 Date: Tue, 4 Aug 2020 21:40:31 +0800 Subject: [PATCH] jconf: fix memory leak --- src/jconf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jconf.c b/src/jconf.c index 5ad6110a..5adba342 100644 --- a/src/jconf.c +++ b/src/jconf.c @@ -218,7 +218,9 @@ read_jconf(const char *file) conf.remote_num = j + 1; } } else if (value->type == json_string) { - parse_addr(to_string(value), conf.remote_addr); + char* tmp_str = to_string(value); + parse_addr(tmp_str, conf.remote_addr); + ss_free(tmp_str); conf.remote_num = 1; } } else if (strcmp(name, "port_password") == 0) {