mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r23875] HDFFV-8322: free allocation before throwing exception.
Tested: local linux
This commit is contained in:
parent
7cdea30a3a
commit
2efbc227cd
@ -568,8 +568,10 @@ H5std_string CommonFG::getComment( const char* name, size_t bufsize ) const
|
||||
|
||||
// if H5Oget_comment_by_name returns SUCCEED, return the string comment,
|
||||
// otherwise, throw an exception
|
||||
if( ret_value < 0 )
|
||||
throwException("getComment", "H5Oget_comment_by_name failed");
|
||||
if( ret_value < 0 ) {
|
||||
delete []comment_C;
|
||||
throwException("getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
|
||||
H5std_string comment = H5std_string(comment_C);
|
||||
delete []comment_C;
|
||||
|
Loading…
Reference in New Issue
Block a user