Skip to contentSkip to conversation

tests/qtest/migration-test: Do not try to print NULL pointer string

PATCH In review Thomas Huth 2 participants 2 messages Oct 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest/migration-test: Do not try to print NULL pointer string

If tmpfs is NULL, we should not try to print it as a string.

Reported-by shengjiangwuqq on github.com
Fixes e5553c1b8d ("tests/qtest: migration-test: Avoid using hardcoded /tmp")
---
 tests/qtest/migration-test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tests/qtest/migration-test.c +1 -2
index ef4427ff4d..de70611f50 100644
@@ -2481,8 +2481,7 @@ int main(int argc, char **argv)
 
     tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err);
     if (!tmpfs) {
-        g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs,
-                       err->message);
+        g_test_message("g_dir_make_tmp failed: %s", err->message);
     }
     g_assert(tmpfs);
 
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Thomas Huth

If tmpfs is NULL, we should not try to print it as a string.

Reported-by shengjiangwuqq on github.com
Fixes e5553c1b8d ("tests/qtest: migration-test: Avoid using hardcoded /tmp")
---
 tests/qtest/migration-test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tests/qtest/migration-test.c +0 -0
index ef4427ff4d..de70611f50 100644

tests/qtest/migration-test.c int main(int argc, char **argv) · line 2486

Quoted 8 lines
tests/qtest/migration-test.c +1 -2
@@ -2481,8 +2481,7 @@ int main(int argc, char **argv)
 
     tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err);
     if (!tmpfs) {
-        g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs,
-                       err->message);
+        g_test_message("g_dir_make_tmp failed: %s", err->message);
     }
     g_assert(tmpfs);