From 9513c9f152909755d080f2ca65b8a7a109a9e946 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 25 Mar 2008 20:28:41 +0000 Subject: Fix g_free that may cause segmentation fault. --- hcid/plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hcid/plugin.c') diff --git a/hcid/plugin.c b/hcid/plugin.c index 1293e70f..b74108bd 100644 --- a/hcid/plugin.c +++ b/hcid/plugin.c @@ -78,12 +78,14 @@ gboolean plugin_init(void) filename = g_build_filename(PLUGINDIR, file, NULL); module = g_module_open(filename, 0); - g_free(filename); if (module == NULL) { error("Can't load plugin %s", filename); + g_free(filename); continue; } + g_free(filename); + debug("%s", g_module_name(module)); if (g_module_symbol(module, "bluetooth_plugin_desc", -- cgit