glib r7581 - in branches/glib-2-18: . glib
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7581 - in branches/glib-2-18: . glib
- Date: Wed, 8 Oct 2008 20:55:10 +0000 (UTC)
Author: chpe
Date: Wed Oct 8 20:55:10 2008
New Revision: 7581
URL: http://svn.gnome.org/viewvc/glib?rev=7581&view=rev
Log:
Bug 555314 â mem leak in gmarkup
Modified:
branches/glib-2-18/ChangeLog
branches/glib-2-18/glib/gmarkup.c
Modified: branches/glib-2-18/glib/gmarkup.c
==============================================================================
--- branches/glib-2-18/glib/gmarkup.c (original)
+++ branches/glib-2-18/glib/gmarkup.c Wed Oct 8 20:55:10 2008
@@ -1096,6 +1096,8 @@
{
gint newlines = 0;
const gchar *p, *q;
+ gchar *current_text_dup;
+
q = p = context->current_text;
while (p != first_invalid)
{
@@ -1111,12 +1113,13 @@
context->line_number += newlines;
context->char_number += g_utf8_strlen (q, first_invalid - q);
+ current_text_dup = g_strndup (context->current_text, context->current_text_len);
set_error (context,
error,
G_MARKUP_ERROR_BAD_UTF8,
_("Invalid UTF-8 encoded text - not valid '%s'"),
- g_strndup (context->current_text,
- context->current_text_len));
+ current_text_dup);
+ g_free (current_text_dup);
goto finished;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]