up-self-test: fix leak by freeing history_dir

Global pointer 'history_dir' is allocated via g_build_filename()
and modified in-place by mkdtemp(), but is never freed with g_free().
After rmdir(history_dir), the allocated string is leaked when the
test returns through g_test_run().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kate Hsuan <hpa@redhat.com>
This commit is contained in:
Kate Hsuan 2026-05-26 16:27:42 +08:00
parent 52b859d7ba
commit 29943f53dd

View file

@ -285,6 +285,8 @@ up_test_history_func (void)
/* remove these test files */
up_test_history_remove_temp_files ();
rmdir (history_dir);
g_free (history_dir);
history_dir = NULL;
}
static void