Skip to content

Commit

Permalink
Fix resource leak
Browse files Browse the repository at this point in the history
As reported by Coverity Scan
  • Loading branch information
tbeu committed Jul 22, 2024
1 parent abe00b8 commit f07ede8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mat73.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,10 @@ Mat_H5ReadVarInfo(matvar_t *matvar, hid_t dset_id)

matvar->internal->id = dset_id;
attr_id = H5Aopen_by_name(dset_id, ".", "MATLAB_class", H5P_DEFAULT, H5P_DEFAULT);
if ( attr_id < 1 )
if ( attr_id < 1 ) {
H5Aclose(attr_id);
return MATIO_E_FAIL_TO_IDENTIFY;
}
type_id = H5Aget_type(attr_id);
class_str = (char *)calloc(H5Tget_size(type_id) + 1, 1);
if ( NULL != class_str ) {
Expand Down

0 comments on commit f07ede8

Please sign in to comment.