From: Michal Bloch Date: Tue, 11 Dec 2018 18:03:22 +0000 (+0100) Subject: Fix `log_config_free` corrupting the config X-Git-Tag: submit/tizen/20181213.113859~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F195218%2F3;p=platform%2Fcore%2Fsystem%2Fdlog.git 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 --- 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; }