summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Exception.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-10-01 04:05:57 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-10-01 04:05:57 (GMT)
commit22d0d32716a588063970a7e412d69a2937118034 (patch)
tree5e4511f0606a402590f3a27ea793006cf4db274e /c++/src/H5Exception.cpp
parent10f1e6acf8916a429f2cc925f49518cfc0015b6c (diff)
downloadhdf5-22d0d32716a588063970a7e412d69a2937118034.zip
hdf5-22d0d32716a588063970a7e412d69a2937118034.tar.gz
hdf5-22d0d32716a588063970a7e412d69a2937118034.tar.bz2
[svn-r25644] Purpose: Fixed HDFFV-8928
Description: Followed hints on the JIRA issue to remove several potential memory leaks. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
Diffstat (limited to 'c++/src/H5Exception.cpp')
-rw-r--r--c++/src/H5Exception.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index 5e7ccd4..f153c92 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -80,8 +80,11 @@ H5std_string Exception::getMajorString( hid_t err_major ) const
// Check for failure again
if( mesg_size < 0 )
+ {
+ delete []mesg_C;
throw IdComponentException("Exception::getMajorString",
"H5Eget_msg failed");
+ }
// Convert the C error description and return
H5std_string major_str(mesg_C);
@@ -116,8 +119,11 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const
// Check for failure again
if( mesg_size < 0 )
+ {
+ delete []mesg_C;
throw IdComponentException("Exception::getMinorString",
"H5Eget_msg failed");
+ }
// Convert the C error description and return
H5std_string minor_str(mesg_C);