Merge "Make operator= and constructor behavior consistent." am: ecfdacd86c am: 7e7e4a3860
am: b419030975

Change-Id: I7944ded56032b4e65aabb407349a54fe1450fdc1
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 6f04838..7add055 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -149,6 +149,7 @@
 }
 
 void hidl_handle::setTo(native_handle_t* handle, bool shouldOwn) {
+    freeHandle();
     mHandle = handle;
     mOwnsHandle = shouldOwn;
 }