From f57cc4a702812b1e0a67cbde407894b58bb31181 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 5 Oct 2020 15:27:24 +0200 Subject: 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. --- src/H5PLpath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v0.12