pidgin: 277dbfa5: Patch from Stefan Becker to plug a coupl...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Fri May 1 12:05:29 EDT 2009


-----------------------------------------------------------------
Revision: 277dbfa504b60a873008deb330ed734a384e33f5
Ancestor: 8567515a55af9b920b1ff380fe95c5f9c138f4ec
Author: nosnilmot at pidgin.im
Date: 2009-05-01T16:00:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/277dbfa504b60a873008deb330ed734a384e33f5

Modified files:
        COPYRIGHT libpurple/mime.c

ChangeLog: 

Patch from Stefan Becker to plug a couple of memory leaks in libpurple/mime.c
Closes #9088

-------------- next part --------------
============================================================
--- COPYRIGHT	bac12f27148815ea9f9a1db78e251dcf739aa28d
+++ COPYRIGHT	ee57a47ef92c72d6a258cc8e1d38f9c12745742b
@@ -30,6 +30,7 @@ Curtis Beattie
 Derek Battams
 Martin Bayard
 Curtis Beattie
+Stefan Becker
 Carlos Bederian
 Dave Bell
 Igor Belyi
============================================================
--- libpurple/mime.c	8d0a515bc926c32234e418ab6289cd30b28f0b5b
+++ libpurple/mime.c	a405c972367fa9fbf62b657104772e06329f9c81
@@ -110,7 +110,7 @@ fields_loadline(struct mime_fields *mf, 
 fields_loadline(struct mime_fields *mf, const char *line, gsize len)
 {
 	/* split the line into key: value */
-	char *key, *val;
+	char *key, *newkey, *val;
 	char **tokens;
 
 	/* feh, need it to be NUL terminated */
@@ -126,17 +126,18 @@ fields_loadline(struct mime_fields *mf, 
 
 	/* normalize whitespace (sorta) and trim on key and value */
 	tokens = g_strsplit(key, "\t\r\n", 0);
-	key = g_strjoinv("", tokens);
-	key = g_strstrip(key);
+	newkey = g_strjoinv("", tokens);
+	g_strstrip(newkey);
 	g_strfreev(tokens);
 
 	tokens = g_strsplit(val, "\t\r\n", 0);
 	val = g_strjoinv("", tokens);
-	val = g_strstrip(val);
+	g_strstrip(val);
 	g_strfreev(tokens);
 
-	fields_set(mf, key, val);
+	fields_set(mf, newkey, val);
 
+	g_free(newkey);
 	g_free(key);
 	g_free(val);
 }
@@ -436,6 +437,8 @@ doc_parts_load(PurpleMimeDocument *doc, 
 
 		b = tail;
 	}
+
+	g_free(bnd);
 }
 
 


More information about the Commits mailing list