changeset 5443:07358c067495

[gaim-migrate @ 5825] fix a segfault for solaris and others committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 18 May 2003 22:35:14 +0000
parents 702071b23c06
children dec7e222a68b
files src/plugin.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugin.c	Sun May 18 22:00:53 2003 +0000
+++ b/src/plugin.c	Sun May 18 22:35:14 2003 +0000
@@ -183,11 +183,13 @@
 	plugin = gaim_plugin_new(is_so_file(filename, PLUGIN_EXT), filename);
 
 	if (plugin->native_plugin) {
+		char *error;
 		plugin->handle = g_module_open(filename, 0);
 
 		if (plugin->handle == NULL) {
+			error = g_module_error();
 			gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n",
-					   plugin->path, g_module_error());
+					   plugin->path, error ? error : "Unknown error.");
 
 			gaim_plugin_destroy(plugin);
 
@@ -199,8 +201,9 @@
 			g_module_close(plugin->handle);
 			plugin->handle = NULL;
 
+			error = g_module_error();
 			gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n",
-					   plugin->path, g_module_error());
+					   plugin->path, error ? error : "Unknown error.");
 
 			gaim_plugin_destroy(plugin);