[ox/fs] Fix memory leak in FileAddress move
This commit is contained in:
parent
74effd3611
commit
c7af7bc54c
@ -84,9 +84,7 @@ FileAddress &FileAddress::operator=(FileAddress &&other) noexcept {
|
|||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case FileAddressType::Path:
|
case FileAddressType::Path:
|
||||||
{
|
{
|
||||||
auto strSize = ox_strlen(other.m_data.path) + 1;
|
m_data.path = other.m_data.path;
|
||||||
m_data.path = new char[strSize];
|
|
||||||
ox_memcpy(m_data.path, other.m_data.path, strSize);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FileAddressType::ConstPath:
|
case FileAddressType::ConstPath:
|
||||||
|
Loading…
Reference in New Issue
Block a user