gtkhtml r9072 - trunk/gtkhtml



Author: mbarnes
Date: Mon Dec 22 05:31:43 2008
New Revision: 9072
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=9072&view=rev

Log:
2008-12-22  Matthew Barnes  <mbarnes redhat com>

	** Fixes part of bug #536625

	* gtkhtml/htmlengine.c (new_parse_body):
	Free the string returned by html_tokenizer_next_token().



Modified:
   trunk/gtkhtml/ChangeLog
   trunk/gtkhtml/htmlengine.c

Modified: trunk/gtkhtml/htmlengine.c
==============================================================================
--- trunk/gtkhtml/htmlengine.c	(original)
+++ trunk/gtkhtml/htmlengine.c	Mon Dec 22 05:31:43 2008
@@ -1374,7 +1374,6 @@
 new_parse_body (HTMLEngine *e, const gchar *end[])
 {
 	HTMLObject *clue = NULL;
-	gchar *str;
 	gchar *rv = NULL;
 
 	g_return_val_if_fail (HTML_IS_ENGINE (e), NULL);
@@ -1382,24 +1381,28 @@
 	e->eat_space = FALSE;
 
 	while (html_tokenizer_has_more_tokens (e->ht) && e->parsing) {
-		str = html_tokenizer_next_token (e->ht);
+		gchar *token;
+
+		token = html_tokenizer_next_token (e->ht);
 
 		/* The token parser has pushed a body we want to use it. */
 		/* CLUECHECK */
 		clue = e->parser_clue;
 		/* printf ("%p <-- clue\n", clue); */
 
-		if (str == NULL)
+		if (token == NULL)
 			break;
 
-		if (*str == '\0')
+		if (*token == '\0') {
+			g_free (token);
 			continue;
+		}
 
-		if (*str != TAG_ESCAPE) {
-			parse_text (e, clue, str);
+		if (*token != TAG_ESCAPE) {
+			parse_text (e, clue, token);
 		} else {
+			gchar *str = token + 1;
 			gint i  = 0;
-			str++;
 
 			while (end [i] != 0) {
 				if (g_ascii_strncasecmp (str, end[i], strlen(end[i])) == 0) {
@@ -1430,6 +1433,8 @@
 
 			}
 		}
+
+		g_free (token);
 	}
 
 	if (!html_tokenizer_has_more_tokens (e->ht) && !e->writing)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]