Skip to content

Commit

Permalink
Fix memory leak inside the move assignment operator of rust::Error class
Browse files Browse the repository at this point in the history
  • Loading branch information
umogSlayer committed Jan 26, 2023
1 parent d49ab22 commit 2f8918f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f8918f

Please sign in to comment.