Merge "Change size_t member of hidl_memory type to uint64_t" am: 1658ce92e3 am: 8a405ea301
am: e4f1734383

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