summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@ovgu.de>2020-10-05 13:27:24 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-10-05 19:42:07 (GMT)
commitb2e40065d1ad402b6cccd4180d9d61f0e570a17d (patch)
tree7ff74c20aadbf7bb5348528d7757ca191cc09d05
parentd665a0d4cf4d62223a892a43c4270b5701d21e38 (diff)
downloadhdf5-b2e40065d1ad402b6cccd4180d9d61f0e570a17d.zip
hdf5-b2e40065d1ad402b6cccd4180d9d61f0e570a17d.tar.gz
hdf5-b2e40065d1ad402b6cccd4180d9d61f0e570a17d.tar.bz2
Fix memory leak in H5PL__find_plugin_in_path
When encountering a directory, the current loop iteration was skipped without freeing the memory allocated for the path.
-rw-r--r--src/H5PLpath.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5PLpath.c b/src/H5PLpath.c
index 1858cf8..3879dc6 100644
--- a/src/H5PLpath.c
+++ b/src/H5PLpath.c
@@ -669,8 +669,10 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo
HDstrerror(errno))
/* If it is a directory, skip it */
- if (S_ISDIR(my_stat.st_mode))
+ if (S_ISDIR(my_stat.st_mode)) {
+ path = (char *)H5MM_xfree(path);
continue;
+ }
/* attempt to open the dynamic library as a filter library */
if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0)