This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to fix memory leak in bfd


   Date: Thu, 2 Sep 1999 18:59:42 +0100
   From: Nick Clifton <nickc@cygnus.com>

     I have just applied the following patch to fix a memory leak in
     bfd.

Thanks.  I wouldn't call that a memory leak--a memory leak is a case
where memory is allocated but never freed.  What you fixed is a case
of memory corruption.

Incidentally, that code appears to have another, less serious, bug,
which is that if realloc or calloc fail, it should call bfd_set_error
(bfd_error_no_memory).  Since it doesn't, a memory allocation failure
will not be reported back to the user correctly.  Most code does this
by calling bfd_malloc or bfd_realloc, in libbfd.c, rather than malloc
or realloc.

Ian

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]