summaryrefslogtreecommitdiffstats
path: root/src/H5PL.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5PL.c')
-rw-r--r--src/H5PL.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/src/H5PL.c b/src/H5PL.c
index c829bf9..5d750fa 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -881,7 +881,6 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info)
} /* end if */
else {
const H5Z_class2_t *plugin_info;
- H5Z_class2_t *plugin_copy = NULL;
/* Invoke H5PLget_plugin_info to verify this is the right library we are looking for.
* Move on if it isn't.
@@ -911,22 +910,8 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info)
(H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id;
H5PL_table_used_g++;
- /* allocate local copy of plugin info */
- if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t))))
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info")
/* Set the plugin info to return */
- *pl_info = (const void *)plugin_copy;
-
- plugin_copy->version = plugin_info->version;
- plugin_copy->id = plugin_info->id;
- plugin_copy->encoder_present = plugin_info->encoder_present;
- plugin_copy->decoder_present = plugin_info->decoder_present;
- plugin_copy->can_apply = plugin_info->can_apply;
- plugin_copy->set_local = plugin_info->set_local;
- plugin_copy->filter = plugin_info->filter;
- /* copy the user's string into the property */
- if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(plugin_info->name)))
- HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name")
+ *pl_info = (const void *)plugin_info;
/* Indicate success */
ret_value = TRUE;
@@ -938,10 +923,6 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info)
} /* end else */
done:
- /* unallocate local copy of plugin info on failure */
- if (FAIL == ret_value && *pl_info) {
- *pl_info = (H5Z_class2_t *)H5MM_xfree(*pl_info);
- }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__open() */
@@ -976,7 +957,6 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info)
if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) {
H5PL_get_plugin_info_t get_plugin_info;
const H5Z_class2_t *plugin_info;
- H5Z_class2_t *plugin_copy = NULL;
if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info")))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
@@ -984,32 +964,13 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info)
if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)()))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info")
- if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t))))
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info")
- /* Set the plugin info to return */
- *info = (const void *)plugin_copy;
-
- plugin_copy->version = plugin_info->version;
- plugin_copy->id = plugin_info->id;
- plugin_copy->encoder_present = plugin_info->encoder_present;
- plugin_copy->decoder_present = plugin_info->decoder_present;
- plugin_copy->can_apply = plugin_info->can_apply;
- plugin_copy->set_local = plugin_info->set_local;
- plugin_copy->filter = plugin_info->filter;
- /* copy the user's string into the property */
- if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(plugin_info->name)))
- HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name")
-
+ *info = plugin_info;
HGOTO_DONE(TRUE)
} /* end if */
} /* end for */
} /* end if */
done:
- /* unallocate local copy of plugin info on failure */
- if (FAIL == ret_value && *info) {
- *info = (H5Z_class2_t *)H5MM_xfree(*info);
- }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__search_table() */