Skip to content

Commit

Permalink
src: fix MallocedBuffer move assignment operator
Browse files Browse the repository at this point in the history
PR-URL: #20883
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
addaleax authored and targos committed May 25, 2018
1 parent 82afb4c commit 418739c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ struct MallocedBuffer {
}
MallocedBuffer& operator=(MallocedBuffer&& other) {
this->~MallocedBuffer();
return *new(this) MallocedBuffer(other);
return *new(this) MallocedBuffer(std::move(other));
}
~MallocedBuffer() {
free(data);
Expand Down

0 comments on commit 418739c

Please sign in to comment.