X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Ftext%2Ftext.c;h=eca7ed73cfe05792df6fe05bc09314f14fe35544;hb=6a18b281a2bf9df3ac2a3ff08601998c52e40bcd;hp=f17442892f563b61056b9af1cf07338a00dbf4eb;hpb=51865548045b997f3fc9768bc85ceefd4703c7ff;p=babeltrace.git diff --git a/plugins/text/text.c b/plugins/text/text.c index f1744289..eca7ed73 100644 --- a/plugins/text/text.c +++ b/plugins/text/text.c @@ -59,6 +59,7 @@ const char *loglevel_str [] = { static void destroy_text_data(struct text_component *text) { + (void) g_string_free(text->string, TRUE); g_free(text); } @@ -71,8 +72,16 @@ struct text_component *create_text(void) if (!text) { goto end; } + text->string = g_string_new(""); + if (!text->string) { + goto error; + } end: return text; + +error: + g_free(text); + return NULL; } static