diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2018-12-14 19:15:09 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2018-12-14 19:15:09 (GMT) |
commit | 74d167d738f719fc1076ed16360e9fd5b7ba4c98 (patch) | |
tree | 1b88b7c3fb5b8f83a97834b34014f1a3f3d3f353 /src/H5VLint.c | |
parent | 7670f112caea0748574b6b1b9752543a168f2538 (diff) | |
download | hdf5-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.c | 9 |
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() */ |