From c1147fc71bf09822aa7e45b5ee20006e25c51614 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 22 Apr 2016 18:48:10 +0200 Subject: libnm/vpn: don't leak editor-plugin if nm_vpn_editor_plugin_load() fails --- libnm-core/nm-vpn-editor-plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libnm-core/nm-vpn-editor-plugin.c') diff --git a/libnm-core/nm-vpn-editor-plugin.c b/libnm-core/nm-vpn-editor-plugin.c index 52c89816ad..792b00f944 100644 --- a/libnm-core/nm-vpn-editor-plugin.c +++ b/libnm-core/nm-vpn-editor-plugin.c @@ -176,7 +176,7 @@ _nm_vpn_editor_plugin_load (const char *plugin_name, if (!success) { g_module_close (module); - editor_plugin = NULL; + g_clear_object (&editor_plugin); } } else { g_set_error (error, @@ -185,7 +185,6 @@ _nm_vpn_editor_plugin_load (const char *plugin_name, _("failed to load nm_vpn_editor_plugin_factory() from %s (%s)"), g_module_name (module), g_module_error ()); g_module_close (module); - editor_plugin = NULL; } return editor_plugin; -- cgit v1.2.1