[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev leaks (was: bug: print vs partial)
From: |
brian j. pardy |
Subject: |
Re: lynx-dev leaks (was: bug: print vs partial) |
Date: |
Fri, 4 Dec 1998 23:23:12 -0800 |
On Fri, Dec 04, 1998, Klaus Weide wrote:
> On Thu, 3 Dec 1998, brian j. pardy wrote:
[...]
> > Line 2575 and 2653 are mine, from cookie_add_acceptlist and
> > cookie_add_rejectlist. It looks like the cookie data itself is already
> > being properly free'd (is the '|' a NULL in memory?), only the domain_entry
> > struct (which is 12 bytes) seems to be left at exit. It would indeed look
> > cleaner to have this cleaned out, but I don't think it's a problem.
>
> >From looking at the code, it seems the domain_entry structures are never
> freed. At least I didn't find where that happens, but I may have missed it.
> If that is true, they should be freed at least in LYCookieJar_free, which
> is only called at exit:
>
> ......
> FREE(de->domain);
> HTList_delete(de->cookie_list);
> de->cookie_list = NULL;
> FREE(dl->object);
> }
> dl = dl->next;
> ......
>
> but I have not tested this.
I just tested it, and it seems to work perfectly.
In patch format, so we have line numbers:
diff -cr 2.8.1dev.8/src/LYCookie.c 2.8.1dev.8.bri/src/LYCookie.c
*** 2.8.1dev.8/src/LYCookie.c Thu Dec 3 10:28:20 1998
--- 2.8.1dev.8.bri/src/LYCookie.c Fri Dec 4 23:17:37 1998
***************
*** 177,182 ****
--- 177,183 ----
FREE(de->domain);
HTList_delete(de->cookie_list);
de->cookie_list = NULL;
+ FREE(dl->object);
}
dl = dl->next;
}
> > Memory leak detected.
> > Pointer: 0x81381e0
> > Contains:: LYNX_VERSION=2.8.2dev.8|
> > ByteSize: 24
> > FileName: ./LYMain.c
> > LineCount: 754
> > realloced: ./LYMain.c
> > LineCount: 755
>
> That looks "permanent". Anyway my patch from Sat, 14 Nov put a
> FREE(lynx_version_putenv_command);
> after the
> putenv(lynx_version_putenv_command);
> but that seems to not have made it into the devel code.
If that FREE() is added back in, that will eliminate all leaks that I see
by simply starting Lynx, and exiting immediately.
--
Let no guilty man escape.
-- U.S. Grant