libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

plug libltdl memory leak with deplibs


From: Eric Blake
Subject: plug libltdl memory leak with deplibs
Date: Tue, 03 Oct 2006 05:55:20 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----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  <address@hidden>

        * libltdl/ltdl.c (load_deplibs): Avoid memleak on failure.
        (unload_deplibs): Avoid memleak on unload.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]