summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Manoj Gupta <manojgupta@google.com> 2017-08-23 08:18:32 +0000
committer android-build-merger <android-build-merger@google.com> 2017-08-23 08:18:32 +0000
commitac18e8a9b0916e38acccaff3ce0967d3fd2a2cb5 (patch)
tree2a6eedaf5507abbcb432e9e1c2ac50389b4772c6
parent628f0c2a38b6068b87714135e227e466ae677641 (diff)
parent97f05421ef377a394608620fb20a1c4d6d7cf6af (diff)
Merge "Fix static analyzer warnings." am: 5b843179ff am: 96e489dc8d am: 369b2032f5
am: 97f05421ef Change-Id: I96cf3364a60641823caf144a856d0fecb2bdfe64
-rw-r--r--libs/binder/Value.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/binder/Value.cpp b/libs/binder/Value.cpp
index fd1dfd5ada..85cd739411 100644
--- a/libs/binder/Value.cpp
+++ b/libs/binder/Value.cpp
@@ -182,10 +182,12 @@ Value& Value::swap(Value &rhs)
Value& Value::operator=(const Value& rhs)
{
- delete mContent;
- mContent = rhs.mContent
- ? rhs.mContent->clone()
- : NULL;
+ if (this != &rhs) {
+ delete mContent;
+ mContent = rhs.mContent
+ ? rhs.mContent->clone()
+ : NULL;
+ }
return *this;
}