changeset 7447:0e7a835e2433

[gaim-migrate @ 8058] I fixed some memleaks. Trying to view someone's log twice causes bad things? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 06 Nov 2003 08:32:17 +0000
parents 064c697cc223
children f3f47de6d8a7
files src/gtkconv.c src/log.c src/protocols/oscar/locate.c
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Thu Nov 06 08:15:11 2003 +0000
+++ b/src/gtkconv.c	Thu Nov 06 08:32:17 2003 +0000
@@ -4716,6 +4716,7 @@
 		g_free(t2); */
 
 		g_free(with_font_tag);
+		g_free(new_message);
 	}
 
 
--- a/src/log.c	Thu Nov 06 08:15:11 2003 +0000
+++ b/src/log.c	Thu Nov 06 08:32:17 2003 +0000
@@ -209,9 +209,10 @@
 		(gaim_find_prpl(gaim_account_get_protocol(account)))->list_icon(account, NULL);
 	char *path = g_build_filename(gaim_user_dir(), "logs", prpl, me, gaim_normalize(account, screenname), NULL);
 
+	g_free(me);
+
 	if (!(dir = g_dir_open(path, 0, NULL))) {
 		g_free(path);
-		g_free(me);
 		return NULL;
 	}
 	while ((filename = g_dir_read_name(dir))) {
@@ -253,6 +254,7 @@
 		}
 	}
 	g_dir_close(dir);
+	g_free(path);
 	return list;
 }
 
@@ -302,6 +304,7 @@
 		dir = g_build_filename(ud, "logs",
 				       prpl, guy, gaim_normalize(log->account, log->name), NULL);
 		mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+		g_free(guy);
 
 		char *filename = g_build_filename(dir, date, NULL);
 		g_free(dir);
@@ -405,6 +408,7 @@
 		dir = g_build_filename(ud, "logs",
 				       prpl, guy, gaim_normalize(log->account, log->name), NULL);
 		mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+		g_free(guy);
 
 		char *filename = g_build_filename(dir, date, NULL);
 		g_free(dir);
@@ -420,6 +424,7 @@
 			gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename);
 			return;
 		}
+		g_free(filename);
 		strftime(date, sizeof(date), "%F %T", localtime(&log->time));
 		fprintf(log->logger_data, "Conversation with %s at %s on %s (%s)\n",
 			log->name, date, gaim_account_get_username(log->account), prpl);
@@ -495,11 +500,15 @@
 	char *path = g_build_filename(gaim_user_dir(), "logs", logfile, NULL);
 	char *newlog;
 
+	g_free(logfile);
+
 	GaimLog *log = NULL;
 	GList *list = NULL;
 
-	if (!(file = fopen(path, "r")))
+	if (!(file = fopen(path, "r"))) {
+		g_free(path);
 		return NULL;
+	}
 
 	while (fgets(buf, BUF_LONG, file)) {
 		if ((newlog = strstr(buf, "---- New C"))) {
--- a/src/protocols/oscar/locate.c	Thu Nov 06 08:15:11 2003 +0000
+++ b/src/protocols/oscar/locate.c	Thu Nov 06 08:32:17 2003 +0000
@@ -249,9 +249,9 @@
 	aim_locate_getinfoshort(sess, cur->sn, 0x00000003);
 }
 
-/*
+/**
  * Remove this screen name from our queue.  If this info was resquested 
- * by our info request queue, then pop off the next element of the queue.
+ * by our info request queue, then pop the next element off of the queue.
  *
  * @param sess The aim session.
  * @param sn Screen name of the info we just received.