[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/16] logging: Fixes memory leak in test-logging.c
From: |
Yonggang Luo |
Subject: |
[PATCH 15/16] logging: Fixes memory leak in test-logging.c |
Date: |
Wed, 9 Sep 2020 03:48:19 +0800 |
g_dir_make_tmp Returns the actual name used. This string should be
freed with g_free() when not needed any longer and is is in the GLib
file name encoding. In case of errors, NULL is returned and error will
be set. Use g_autofree to free it properly
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/test-logging.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 8a1161de1d..957f6c08cd 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -196,7 +196,7 @@ static void rmdir_full(gchar const *root)
int main(int argc, char **argv)
{
- gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX", NULL);
+ g_autofree gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX",
NULL);
int rc;
g_test_init(&argc, &argv, NULL);
--
2.28.0.windows.1
- Re: [PATCH 11/16] meson: disable crypto tests are empty under win32, (continued)
[PATCH 12/16] meson: remove empty else and duplicated gio deps, Yonggang Luo, 2020/09/08
[PATCH 13/16] vmstate: Fixes test-vmstate.c on msys2/mingw, Yonggang Luo, 2020/09/08
[PATCH 14/16] cirrus: Building freebsd in a single short, Yonggang Luo, 2020/09/08
[PATCH 15/16] logging: Fixes memory leak in test-logging.c,
Yonggang Luo <=
[PATCH 16/16] rcu: add uninit destructor for rcu, Yonggang Luo, 2020/09/08
Re: [PATCH 00/16] W32, W64 patches, Eric Blake, 2020/09/08