pidgin: 070f6fdc: Fix some potential leakage in the crazin...

datallah at pidgin.im datallah at pidgin.im
Wed May 7 15:45:47 EDT 2008


-----------------------------------------------------------------
Revision: 070f6fdcb1f05cf7712346380a3755e800301c13
Ancestor: f388ae7c8eb8f7f38f0b5c8fa5e43547bd781925
Author: datallah at pidgin.im
Date: 2008-05-07T19:43:40
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/070f6fdcb1f05cf7712346380a3755e800301c13

Modified files:
        libpurple/util.c

ChangeLog: 

Fix some potential leakage in the craziness called purple_markup_html_to_xhtml().

-------------- next part --------------
============================================================
--- libpurple/util.c	351b7da3cff934b95fe4b7685ac065a3ae54bcfd
+++ libpurple/util.c	bd1efb88bba75a998861b7b3acea6a7c8e0aa8c1
@@ -1525,6 +1525,8 @@ purple_markup_html_to_xhtml(const char *
 					while(*p && *p != '>') {
 						if(!g_ascii_strncasecmp(p, "src=", strlen("src="))) {
 							const char *q = p + strlen("src=");
+							if (src)
+								g_string_free(src, TRUE);
 							src = g_string_new("");
 							if(*q == '\'' || *q == '\"')
 								q++;
@@ -1535,6 +1537,8 @@ purple_markup_html_to_xhtml(const char *
 							p = q;
 						} else if(!g_ascii_strncasecmp(p, "alt=", strlen("alt="))) {
 							const char *q = p + strlen("alt=");
+							if (alt)
+								g_string_free(alt, TRUE);
 							alt = g_string_new("");
 							if(*q == '\'' || *q == '\"')
 								q++;
@@ -1572,6 +1576,8 @@ purple_markup_html_to_xhtml(const char *
 							if (url)
 								g_string_free(url, TRUE);
 							url = g_string_new("");
+							if (cdata)
+								g_string_free(cdata, TRUE);
 							cdata = g_string_new("");
 							if(*q == '\'' || *q == '\"')
 								q++;
@@ -4209,8 +4215,7 @@ purple_uri_list_extract_filenames(const 
 			/* not sure if this fallback is useful at all */
 			if (!node->data) node->data = g_strdup (s+5);
 		} else {
-			result = g_list_remove_link(result, node);
-			g_list_free_1 (node);
+			result = g_list_delete_link(result, node);
 		}
 		g_free (s);
 	}


More information about the Commits mailing list