bug-glibc
[Top][All Lists]
Advanced

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

possible leak in elf/dl_open.c


From: Michael Meeks
Subject: possible leak in elf/dl_open.c
Date: Sat, 8 Dec 2001 01:35:46 -0500 (EST)

        I get a leak report from 'memprof' for glibc-2.2.4-19, on RH
7.1 intel.

        It seems like an obvious one to me but, I only have the 2.1.2
source localy:

elf/dl_open.c (_dl_open)

     ...

      /* Make a local copy of the error string so that we can release the
         memory allocated for it.  */
      local_errstring = strdupa (errstring);
      free (errstring);

      /* Reraise the error.  */
      _dl_signal_error (errcode, NULL, local_errstring);
    }

  return args.map;
}

        It seems contractualy broken to get _dl_signal_error to free
the string you send it ( which it doesn't anyway ); suggested patch:

-      /* Make a local copy of the error string so that we can release the
-        memory allocated for it.  */
-      local_errstring = strdupa (errstring);
-      free (errstring);

      /* Reraise the error.  */
-      _dl_signal_error (errcode, NULL, local_errstring);
+      _dl_signal_error (errcode, NULL, errstring);

        HTH,

                Michael Meeks.

-- 
 address@hidden  <><, Pseudo Engineer, itinerant idiot




reply via email to

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