summaryrefslogtreecommitdiff
path: root/cpputil
diff options
context:
space:
mode:
authorDennis Jackson <djackson@mozilla.com>2022-03-22 13:34:07 +0000
committerDennis Jackson <djackson@mozilla.com>2022-03-22 13:34:07 +0000
commit12a82009867d23ceb792c5bf7c9fe65708f93dc9 (patch)
tree29ec32b6990c84eb5df1d2c2df152dbb5d52a6b6 /cpputil
parent1e1791002a5bddb0b5dee8a75889f312b193ff6e (diff)
downloadnss-hg-12a82009867d23ceb792c5bf7c9fe65708f93dc9.tar.gz
Bug 1758478 - Fix DataBuffer Move Assignment. r=mt
Differential Revision: https://phabricator.services.mozilla.com/D141650
Diffstat (limited to 'cpputil')
-rw-r--r--cpputil/databuffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpputil/databuffer.h b/cpputil/databuffer.h
index 8d34e1a7d..d7c80b4bb 100644
--- a/cpputil/databuffer.h
+++ b/cpputil/databuffer.h
@@ -33,7 +33,8 @@ class DataBuffer {
return *this;
}
DataBuffer& operator=(DataBuffer&& other) {
- if (this == &other) {
+ if (this != &other) {
+ delete[] data_;
data_ = other.data_;
len_ = other.len_;
other.data_ = nullptr;