We leak global_filename, and do not close global_file. Let's fix that. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru> ---
Interesting: seems, nobody is maintainer of util/log.c util/log.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/log.c b/util/log.c index d36c98da0b..30de209210 100644 --- a/util/log.c +++ b/util/log.c @@ -85,6 +85,15 @@ static void qemu_log_thread_cleanup(Notifier *n, void *unused) } } +static void __attribute__((__destructor__)) cleanup(void) +{ + g_free(global_filename); + if (global_file && global_file != stderr) { + fclose(global_file); + global_file = NULL; + } +} + /* Lock/unlock output. */ static FILE *qemu_log_trylock_with_err(Error **errp) -- 2.34.1