[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev leaks (was: bug: print vs partial)
From: |
Klaus Weide |
Subject: |
Re: lynx-dev leaks (was: bug: print vs partial) |
Date: |
Fri, 4 Dec 1998 04:45:54 -0600 (CST) |
On Thu, 3 Dec 1998, brian j. pardy wrote:
> > Is this a permanent one?
>
> Memory leak detected.
> Pointer: 0x8167ac0
> Contains:: <h1>Lynx (2.8.2dev.8), help on <a href="file://loc
> ByteSize: 297
> FileName: ../../../WWW/Library/Implementation/HTString.c
> LineCount: 349
Is that from the cookie code? It is hard to tell.
> Simply starting Lynx and viewing the cookie jar page seems to leak about
> 30k (I have a lot of cookies when I start up).
>
>
> I'm not sure exactly how to go about determining if a leak is permanent or
> non-permanent, and looking back through the cookie code, the leaks I was
> thinking of before seem to not be a problem. I think they are simply the
> domain entries for each domain, which are still used (if I free them, we
> get empty cookies during runtime). These leaks are:
>
> Memory leak detected.
> Pointer: 0x81589f0
> Contains:: ||||||||||||
> ByteSize: 12
> FileName: ./LYCookie.c
> LineCount: 402
>
> Memory leak detected.
> Pointer: 0x8148110
> Contains:: ||||||||||||
> ByteSize: 12
> FileName: ./LYCookie.c
> LineCount: 2575
>
>
> Memory leak detected.
> Pointer: 0x8147bc0
> Contains:: ||||||||||||
> ByteSize: 12
> FileName: ./LYCookie.c
> LineCount: 2653
>
> 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.
> Another leak at:
>
> 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.
Klaus