From c7af7bc54cbd2231f36a83da6f0fb5e343bf7c53 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 24 May 2022 20:31:30 -0500 Subject: [PATCH] [ox/fs] Fix memory leak in FileAddress move --- deps/ox/src/ox/fs/filesystem/filelocation.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deps/ox/src/ox/fs/filesystem/filelocation.cpp b/deps/ox/src/ox/fs/filesystem/filelocation.cpp index 75212f2a..4ec15139 100644 --- a/deps/ox/src/ox/fs/filesystem/filelocation.cpp +++ b/deps/ox/src/ox/fs/filesystem/filelocation.cpp @@ -84,9 +84,7 @@ FileAddress &FileAddress::operator=(FileAddress &&other) noexcept { switch (m_type) { case FileAddressType::Path: { - auto strSize = ox_strlen(other.m_data.path) + 1; - m_data.path = new char[strSize]; - ox_memcpy(m_data.path, other.m_data.path, strSize); + m_data.path = other.m_data.path; break; } case FileAddressType::ConstPath: