comparison libpurple/protocols/msn/msnutils.c @ 20990:bc731b26335c

Leak fixes.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 19 Oct 2007 01:28:55 +0000
parents 64644b98c20c
children 50e5ac417035 75be80ddeca5
comparison
equal deleted inserted replaced
20989:2097b1664fa3 20990:bc731b26335c
164 * Currently only support the UTF-8 and base64 encode 164 * Currently only support the UTF-8 and base64 encode
165 */ 165 */
166 char * 166 char *
167 msn_encode_mime(const char *str) 167 msn_encode_mime(const char *str)
168 { 168 {
169 char *base64; 169 gchar *base64, *retval;
170
171 g_return_val_if_fail(str != NULL, NULL);
170 172
171 base64 = purple_base64_encode((guchar *)str, strlen(str)); 173 base64 = purple_base64_encode((guchar *)str, strlen(str));
172 return g_strdup_printf("=?utf-8?B?%s?=", base64); 174 retval = g_strdup_printf("=?utf-8?B?%s?=", base64);
175 g_free(base64);
176
177 return retval;
173 } 178 }
174 179
175 /* 180 /*
176 * We need this because we're only supposed to encode spaces in the font 181 * We need this because we're only supposed to encode spaces in the font
177 * names. purple_url_encode() isn't acceptable. 182 * names. purple_url_encode() isn't acceptable.