hidl_string: allow null cstr am: a21d84f11f am: 55107b3754 am: f78b5afd0a
am: 072984bb72

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