changeset 787:53d2e3e02297

[gaim-migrate @ 797] plugging plugin leaks. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 Aug 2000 18:24:26 +0000
parents ffb824f6cd24
children 9cdc6ea9647f
files src/plugins.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins.c	Tue Aug 29 06:02:43 2000 +0000
+++ b/src/plugins.c	Tue Aug 29 18:24:26 2000 +0000
@@ -166,6 +166,7 @@
 		g_snprintf(buf, BUF_LEN - 1, "%s/%s", getenv("HOME"), PLUGIN_DIR);
 		plug->filename = g_malloc(strlen(buf) + strlen(filename) + 1);
 		sprintf(plug->filename, "%s%s", buf, filename);
+		g_free(buf);
 	} else
 		plug->filename = g_strdup(filename);
 	sprintf(debug_buff, "Loading %s\n", filename);
@@ -177,6 +178,7 @@
 	if (!plug->handle) {
 		error = (char *)dlerror();
 		do_error_dialog(error, _("Plugin Error"));
+		g_free(plug->filename);
 		g_free(plug);
 		return;
 	}
@@ -185,6 +187,7 @@
 	if ((error = (char *)dlerror()) != NULL) {
 		do_error_dialog(error, _("Plugin Error"));
 		dlclose(plug->handle);
+		g_free(plug->filename);
 		g_free(plug);
 		return;
 	}
@@ -217,6 +220,7 @@
 				do_error_dialog(plugin_error, _("Plugin Error"));
 		}
 		dlclose(plug->handle);
+		g_free(plug->filename);
 		g_free(plug);
 		return;
 	}