From 12a82009867d23ceb792c5bf7c9fe65708f93dc9 Mon Sep 17 00:00:00 2001 From: Dennis Jackson Date: Tue, 22 Mar 2022 13:34:07 +0000 Subject: Bug 1758478 - Fix DataBuffer Move Assignment. r=mt Differential Revision: https://phabricator.services.mozilla.com/D141650 --- cpputil/databuffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpputil') 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; -- cgit v1.2.1