changeset 898:c65b71dcda94

Fix memory leak in scr_UpdateWindow()
author Mikael Berthe <mikael@lilotux.net>
date Thu, 08 Jun 2006 21:42:52 +0200
parents a05b5a16a06a
children a833f3d6119a
files mcabber/src/hbuf.c mcabber/src/screen.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/hbuf.c	Thu Jun 08 21:29:09 2006 +0200
+++ b/mcabber/src/hbuf.c	Thu Jun 08 21:42:52 2006 +0200
@@ -245,7 +245,8 @@
 //  hbuf_get_lines(hbuf, n)
 // Returns an array of n hbb_line pointers
 // (The first line will be the line currently pointed by hbuf)
-// Note: The caller should free the array and the text pointers after use.
+// Note: The caller should free the array, the hbb_line pointers and the
+// text pointers after use.
 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n)
 {
   unsigned int i;
--- a/mcabber/src/screen.c	Thu Jun 08 21:29:09 2006 +0200
+++ b/mcabber/src/screen.c	Thu Jun 08 21:42:52 2006 +0200
@@ -572,6 +572,7 @@
         wattrset(win_entry->win, get_color(COLOR_GENERAL));
       wclrtoeol(win_entry->win);
       g_free(line->text);
+      g_free(line);
     } else {
       wclrtobot(win_entry->win);
       break;