bug-libtool
[Top][All Lists]
Advanced

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

Memory leak in ltdl.c


From: Alan DeKok
Subject: Memory leak in ltdl.c
Date: Fri, 09 Feb 2001 11:13:53 -0500

  I use libtool to develop a daemon (www.freeradius.org).  We tracked
down a leak in the server to ltld.c

  The background is that the server re-reads it's configuration files
on every HUP, unlinks all loaded modules, and links in the new ones.
We discovered it was leaking ~500 bytes per HUP.  One of the other
developers tracked it down to ltdl.

  I haven't included system information, as the problem was seen
across all systems we tests on.

  We're using the last released libtool, 1.3.4.

  Anyways, the patch below fixes the problem for us.


  Alan DeKok.



--- ltdl.c.orig Fri Feb  9 11:09:26 2001
+++ ltdl.c      Fri Feb  9 11:09:30 2001
@@ -1347,10 +1347,11 @@
                if (error) {
                        lt_dlfree(handle);
                        free_vars(name, dir, dlname, old_name, libdir, deplibs);
                        return 0;
                }
+               free_vars(NULL, NULL, dlname, old_name, libdir, deplibs);
                if (handle != newhandle) {
                        unload_deplibs(handle);
                }
        } else {
                /* not a libtool module */



reply via email to

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