mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-06-11 18:48:25 +02:00
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:
parent
52b859d7ba
commit
29943f53dd
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue