mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
Merge pull request #1167 from umogSlayer/fix-move-assignment-memory-leak
Fix memory leak inside the move assignment operator of rust::Error class
This commit is contained in:
commit
320b7af3eb
@ -488,6 +488,7 @@ Error &Error::operator=(const Error &other) & {
|
||||
|
||||
Error &Error::operator=(Error &&other) &noexcept {
|
||||
std::exception::operator=(std::move(other));
|
||||
delete[] this->msg;
|
||||
this->msg = other.msg;
|
||||
this->len = other.len;
|
||||
other.msg = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user