-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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?
2006-10-02 Eric Blake <[EMAIL PROTECTED]> * libltdl/ltdl.c (load_deplibs): Avoid memleak on failure. (unload_deplibs): Avoid memleak on unload. - -- 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 iD8DBQFFIk+o84KuGfSFAYARAmzRAJ9dbXbzgJfuegZiK4fC2/wKWox0cQCffCDp Y7Aw/ZxdLmd+CgSpKI2xcmM= =qxzw -----END PGP SIGNATURE-----
Index: libltdl/ltdl.c =================================================================== RCS file: /sources/libtool/libtool/libltdl/ltdl.c,v retrieving revision 1.244 diff -u -p -r1.244 ltdl.c --- libltdl/ltdl.c 4 Sep 2006 17:43:37 -0000 1.244 +++ libltdl/ltdl.c 3 Oct 2006 11:52:25 -0000 @@ -855,7 +855,7 @@ load_deplibs (lt_dlhandle handle, char * cur->deplibs = (lt_dlhandle *) MALLOC (lt__handle, depcount); 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); } return errors;