summaryrefslogtreecommitdiffstats
path: root/src/H5VLint.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2018-12-14 19:15:09 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2018-12-14 19:15:09 (GMT)
commit74d167d738f719fc1076ed16360e9fd5b7ba4c98 (patch)
tree1b88b7c3fb5b8f83a97834b34014f1a3f3d3f353 /src/H5VLint.c
parent7670f112caea0748574b6b1b9752543a168f2538 (diff)
downloadhdf5-74d167d738f719fc1076ed16360e9fd5b7ba4c98.zip
hdf5-74d167d738f719fc1076ed16360e9fd5b7ba4c98.tar.gz
hdf5-74d167d738f719fc1076ed16360e9fd5b7ba4c98.tar.bz2
Make sure to free copy of VOL connector's name when H5VL_register_connector fails
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r--src/H5VLint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c
index 82886cd..147e996 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -625,9 +625,12 @@ H5VL_register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID")
done:
- if (ret_value < 0)
- if (saved)
- H5FL_FREE(H5VL_class_t, saved);
+ if (ret_value < 0 && saved) {
+ if (saved->name)
+ H5MM_xfree(saved->name);
+
+ H5FL_FREE(H5VL_class_t, saved);
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_register_connector() */