From 91b3de5fadfbf80069ffdc03613462d10b7c4fe4 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Wed, 21 Nov 2018 11:00:20 +0100 Subject: [PATCH] Fix crash if unable to load plugin. --- src/core/pluginloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/pluginloader.c b/src/core/pluginloader.c index 17ed335..77b49e4 100644 --- a/src/core/pluginloader.c +++ b/src/core/pluginloader.c @@ -102,7 +102,6 @@ struct plugin_handle* plugin_load(const char* filename, const char* config, stru int ret; struct plugin_handle* handle = (struct plugin_handle*) hub_malloc_zero(sizeof(struct plugin_handle)); struct uhub_plugin* plugin = plugin_open(filename); - struct plugin_hub_internals* internals = (struct plugin_hub_internals*) plugin->internals; if (!plugin) return NULL; @@ -118,6 +117,7 @@ struct plugin_handle* plugin_load(const char* filename, const char* config, stru unregister_f = plugin_lookup_symbol(plugin, "plugin_unregister"); // register hub internals + struct plugin_hub_internals* internals = (struct plugin_hub_internals*) plugin->internals; internals->unregister = unregister_f; internals->hub = hub; internals->callback_data = plugin_callback_data_create();