[Verse-dev] Bug in text handling

Emil Brink emil at obsession.se
Fri Sep 24 13:19:35 CEST 2004


Hi all.

I just found (thanks to the lovely Valgrind[1] tool, which I
heartily recommend every Linux-using programmer to try) and, I
believe, fixed a memory leak bug in the Verse reference host's
handling of text lines. The fix is simply the addition of a
missing free() call, like so:

--- v_man_pack_node.c   24 Sep 2004 10:21:20 -0000      1.10.2.4
+++ v_man_pack_node.c   24 Sep 2004 10:21:42 -0000      1.10.2.5
@@ -162,6 +162,7 @@ unsigned int v_unpack_t_text_set(const c
                                if(line->text != NULL)
                                        free(line->text);
                                past = NULL;
+                               free(line);
                                line = s->text_temp;
                                s->text_receive_id++;
                        }else

I'm not very familiar with the code in question, but I do think
this is proper, and it shuts Valgrind up too.

Fix is only in CVS for now.

Regards,

/Emil

[1] See <http://valgrind.kde.org/> for details on Valgrind.


More information about the Verse-dev mailing list