H5D_GET_TYPE returns an identifier for a copy of the datatype for a dataset. The datatype should be released with the H5T_CLOSE function.
If a dataset has a named datatype, then an identifier to the opened datatype is returned. Otherwise, the returned datatype is read-only. If atomization of the datatype fails, then the datatype is closed.
A datatype identifier returned from this function should be released with H5T_CLOSE when the identifier is no longer needed so that resource leaks will not occur.