am 412d55c7: Merge "fix fd leaking and deallocation freed resource"

* commit '412d55c7ee5ce42dc52e0c03c3e0d1c5c2d9d870':
  fix fd leaking and deallocation freed resource