From e086def5fe3cd3bc7ed4428b72a4ee94763c3ec2 Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Tue, 11 Dec 2018 19:03:22 +0100 Subject: [PATCH] Fix `log_config_free` corrupting the config It used to leave the config in a corrupt state that referenced freed memory and leaked any added entries. This did not cause any actual problems because no config structure was ever reused in production code, only in tests which do that for convenience. Change-Id: I90a52c31ca2985ab9c67b32849bca426fb3f1ed7 Signed-off-by: Michal Bloch --- src/shared/logconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/logconfig.c b/src/shared/logconfig.c index edad451..3839fe5 100644 --- a/src/shared/logconfig.c +++ b/src/shared/logconfig.c @@ -332,7 +332,7 @@ void log_config_free(struct log_config* config) free(prev); } - config->begin = NULL; + config->begin = config->last = NULL; } -- 2.7.4