From dd85995180e794af3125396e10623af80b9e0ff1 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (glassez)" Date: Sun, 16 Feb 2025 07:36:08 +0300 Subject: [PATCH] Fix use-after-move in test_storage --- test/test_storage.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_storage.cpp b/test/test_storage.cpp index 9cb8380953..64a120f7c6 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -928,11 +928,12 @@ void test_fastresume(bool const test_deprecated) p.storage_mode = storage_mode_sparse; error_code ignore; torrent_handle h = ses.add_torrent(std::move(p), ignore); - TEST_CHECK(exists(combine_path(p.save_path, "temporary"))); - if (!exists(combine_path(p.save_path, "temporary"))) + + torrent_status s = h.status(); + TEST_CHECK(exists(combine_path(s.save_path, "temporary"))); + if (!exists(combine_path(s.save_path, "temporary"))) return; - torrent_status s; for (int i = 0; i < 50; ++i) { print_alerts(ses, "ses");