From e0a6a0d085e7918f1128d6300aa64361467a0c3f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 14 Oct 2021 10:09:25 -0400 Subject: [PATCH] hs: Fix memory leak if service failed to configure Closes #40484 Signed-off-by: David Goulet --- changes/ticket40484 | 5 +++++ src/feature/hs/hs_config.c | 1 + 2 files changed, 6 insertions(+) create mode 100644 changes/ticket40484 diff --git a/changes/ticket40484 b/changes/ticket40484 new file mode 100644 index 0000000000..9a9ffdf448 --- /dev/null +++ b/changes/ticket40484 @@ -0,0 +1,5 @@ + o Minor bugfixes (onion service, config): + - Fix a memory leak for a small config line string that could occur if the + service failed to be configured from file properly. Fixes bug 40484; + bugfix on 0.3.2.1-alpha. + diff --git a/src/feature/hs/hs_config.c b/src/feature/hs/hs_config.c index f9f71c78f2..de1f608ddf 100644 --- a/src/feature/hs/hs_config.c +++ b/src/feature/hs/hs_config.c @@ -640,6 +640,7 @@ hs_config_service_all(const or_options_t *options, int validate_only) int rv = config_service(section, options, new_service_list); config_free_lines(section); if (rv < 0) { + config_free_lines(remaining); goto err; } }