comparison src/module.c @ 4135:4927f8dd046f

[gaim-migrate @ 4353] Memory leak fixes. Thanks Ari Pollak. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 24 Dec 2002 23:41:01 +0000
parents b359aab1c576
children 9c7fcb211886
comparison
equal deleted inserted replaced
4134:c0f4c664e3ba 4135:4927f8dd046f
120 ) && g_module_supported()) { 120 ) && g_module_supported()) {
121 path = g_build_filename(probedirs[l], file, NULL); 121 path = g_build_filename(probedirs[l], file, NULL);
122 handle = g_module_open(path, 0); 122 handle = g_module_open(path, 0);
123 if (!handle) { 123 if (!handle) {
124 debug_printf("%s is unloadable: %s\n", file, g_module_error()); 124 debug_printf("%s is unloadable: %s\n", file, g_module_error());
125 g_free(path);
125 continue; 126 continue;
126 } 127 }
127 if (g_module_symbol(handle, "gaim_prpl_init", (gpointer *)&gaim_prpl_init)) { 128 if (g_module_symbol(handle, "gaim_prpl_init", (gpointer *)&gaim_prpl_init)) {
128 plug = g_new0(struct gaim_plugin, 1); 129 plug = g_new0(struct gaim_plugin, 1);
129 g_snprintf(plug->path, sizeof(plug->path), path); 130 g_snprintf(plug->path, sizeof(plug->path), path);
134 gaim_prpl_init(new_prpl); 135 gaim_prpl_init(new_prpl);
135 if (new_prpl->protocol == PROTO_ICQ || 136 if (new_prpl->protocol == PROTO_ICQ ||
136 find_prpl(new_prpl->protocol)) { 137 find_prpl(new_prpl->protocol)) {
137 /* Nothing to see here--move along, move along */ 138 /* Nothing to see here--move along, move along */
138 unload_protocol(new_prpl); 139 unload_protocol(new_prpl);
140 g_free(path);
139 continue; 141 continue;
140 } 142 }
141 protocols = g_slist_insert_sorted(protocols, new_prpl, (GCompareFunc)proto_compare); 143 protocols = g_slist_insert_sorted(protocols, new_prpl, (GCompareFunc)proto_compare);
142 g_module_close(handle); 144 g_module_close(handle);
145 g_free(path);
143 continue; 146 continue;
144 } 147 }
145 148
146 if (!g_module_symbol(handle, "gaim_plugin_init", (gpointer *)&gaim_plugin_init)) { 149 if (!g_module_symbol(handle, "gaim_plugin_init", (gpointer *)&gaim_plugin_init)) {
147 debug_printf("%s is unloadable %s\n", file, g_module_error()); 150 debug_printf("%s is unloadable %s\n", file, g_module_error());
148 g_module_close(handle); 151 g_module_close(handle);
152 g_free(path);
149 continue; 153 continue;
150 } 154 }
151 plug = g_new0(struct gaim_plugin, 1); 155 plug = g_new0(struct gaim_plugin, 1);
152 g_snprintf(plug->path, sizeof(plug->path), path); 156 g_snprintf(plug->path, sizeof(plug->path), path);
153 plug->type = plugin; 157 plug->type = plugin;