diff --git a/libhdf5/hdf5plugins.c b/libhdf5/hdf5plugins.c index 85e70948be..ac03cf57d1 100644 --- a/libhdf5/hdf5plugins.c +++ b/libhdf5/hdf5plugins.c @@ -47,7 +47,7 @@ static const NC_PluginPathDispatch pluginpathtable = { NC4_hdf5_plugin_path_write }; -const NC_PluginPathDispatch* NC4_hdf5_pluginpathtable = &pluginpathtable; +const NC_PluginPathDispatch* NC4_hdf5_pluginpathtable = NULL; /**************************************************/ @@ -67,6 +67,9 @@ NC4_hdf5_plugin_path_initialize(void** statep, const NClist* initialpaths) assert(statep != NULL); if(*statep != NULL) goto done; /* already initialized */ + + NC4_hdf5_pluginpathtable = &pluginpathtable; + if((g5 = (GlobalHDF5*)calloc(1,sizeof(GlobalHDF5)))==NULL) {stat = NC_ENOMEM; goto done;} *statep = (void*)g5; g5 = NULL; done: diff --git a/libnczarr/zplugins.c b/libnczarr/zplugins.c index d96d2b8ba9..c35524eea0 100644 --- a/libnczarr/zplugins.c +++ b/libnczarr/zplugins.c @@ -68,7 +68,7 @@ static const NC_PluginPathDispatch pluginpathtable = { NCZ_plugin_path_write, }; -const NC_PluginPathDispatch* NCZ_pluginpathtable = &pluginpathtable; +const NC_PluginPathDispatch* NCZ_pluginpathtable = NULL; /**************************************************/ /** @@ -86,6 +86,8 @@ NCZ_plugin_path_initialize(void** statep, const NClist* initialpaths) assert(statep != NULL); if(*statep != NULL) goto done; /* already initialized */ + NCZ_pluginpathtable = &pluginpathtable; + if((gz = (GlobalNCZarr*)calloc(1,sizeof(GlobalNCZarr)))==NULL) {stat = NC_ENOMEM; goto done;} gz->pluginpaths = nclistnew();