-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Ralf,
According to Ralf Wildenhues on 10/6/2006 7:58 AM: > Hello Eric, > > * Eric Blake wrote on Tue, Oct 03, 2006 at 01:55:20PM CEST: >> I noticed this while debugging a memory leak in m4. This is against head, >> but if it is approved, I imagine it needs to be backported to the branch >> as well. OK to apply? > > The first hunk looks good, I'm not so sure about the second. > Which system do you see this on, and how do you track memleaks down > there? I found this on cygwin, by using the Windows Task Manager to track heap usage as I repeatedly loaded and unloaded a dlpreopen'd module. Since the heap usage kept growing, there was a leak; from there, I opened a debugger, and noticed that in unload_deplibs, *cur included references to heap locations. >> @@ -855,7 +855,7 @@ load_deplibs (lt_dlhandle handle, char * >> >> cur->deplibs = (lt_dlhandle *) MALLOC (lt__handle, depcount); This hunk of load_deplibs MALLOCS deplibs,... >> if (!cur->deplibs) >> - goto cleanup; >> + goto cleanup_names; >> >> for (i = 0; i < depcount; ++i) >> { >> @@ -903,6 +903,7 @@ unload_deplibs (lt_dlhandle handle) >> errors += lt_dlclose (cur->deplibs[i]); >> } >> } >> + FREE (cur->deplibs); ...so it's only fair for the unload counterpart to free it. I stand by both hunks of the patch. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFJm7b84KuGfSFAYARAmzpAJ9zw+55kcZ6wKBbpPVS+t7qsu9XSgCeNYiF 4dm3iX4ElJjf0cq9ZpRJh/I= =2xtV -----END PGP SIGNATURE-----