summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStu Tomlinson <nosnilmot@pidgin.im>2009-05-01 16:05:55 +0000
committerStu Tomlinson <nosnilmot@pidgin.im>2009-05-01 16:05:55 +0000
commit73d07d65aa2c3f40b0cb8f0561cb4b5d9f2fba79 (patch)
tree5e3585ba171b17f998030082cb52629b64c35291
parentdb1544e7cc04734c1a15d0a7c11e1292284b463b (diff)
downloadpidgin-73d07d65aa2c3f40b0cb8f0561cb4b5d9f2fba79.tar.gz
applied changes from 8567515a55af9b920b1ff380fe95c5f9c138f4ec
through 277dbfa504b60a873008deb330ed734a384e33f5 Patch from Stefan Becker to plug a couple of memory leaks in libpurple/mime.c References #9088
-rw-r--r--COPYRIGHT1
-rw-r--r--libpurple/mime.c13
2 files changed, 9 insertions, 5 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
index a46ffdfb14..42b80b274f 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -30,6 +30,7 @@ Lukas Barth
Derek Battams
Martin Bayard
Curtis Beattie
+Stefan Becker
Dave Bell
Igor Belyi
Brian Bernas
diff --git a/libpurple/mime.c b/libpurple/mime.c
index 6dae7a5f08..ed4840e5e5 100644
--- a/libpurple/mime.c
+++ b/libpurple/mime.c
@@ -113,7 +113,7 @@ static void
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 */
@@ -129,17 +129,18 @@ fields_loadline(struct mime_fields *mf, const char *line, gsize len)
/* 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);
}
@@ -439,6 +440,8 @@ doc_parts_load(PurpleMimeDocument *doc, const char *boundary, const char *buf, g
b = tail;
}
+
+ g_free(bnd);
}