Subject: Re: memory leak in psiconv
frodol@dds.nl
Date: Mon Jan 28 2002 - 15:03:27 CST
Tomas Frydrych wrote:
>
>
> I found a memory leak in psiconv; the attached patch might fix that,
> but the question is whether the missing free should not be located
> in psiconv_list_free() instead of psiconv_buffer_free(); I will leave
> that to Frodo to decide.
You are right; there is a glaring, stupid error in psiconv_list_free.
The right patch is:
Index: lib/psiconv/list.c
===================================================================
RCS file: /home/cvs/psiconv/lib/psiconv/list.c,v
retrieving revision 1.13
diff -u -2 -r1.13 list.c
--- list.c 2001/01/29 21:57:05 1.13
+++ list.c 2002/01/28 21:00:37
@@ -54,7 +54,6 @@
if (l->max_len)
free(l->els);
- l->max_len = 0;
- l->cur_len = 0;
- l->els = NULL;
+ free(l);
+ l = NULL;
Don't know how this ever could happen...
(I didn't commit this yet; I have been busy with real-life and recovering
from a disk crash, so I am not sure what the commit policy is with 1.0
coming near).
Thanks,
Frodo
-- Frodo Looijaard <frodol@dds.nl> PGP key and more: http://huizen.dds.nl/~frodol Defenestration n. (formal or joc.): The act of removing Windows from your computer in disgust, usually followed by the installation of Linux or some other Unix-like operating system.
This archive was generated by hypermail 2b25 : Mon Jan 28 2002 - 15:03:41 CST