This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/2077] memory leak in libio/iofdopen.c


------- Additional Comments From jakub at redhat dot com  2005-12-21 10:35 -------
Then your assumption is wrong:
struct locked_FILE
{
  struct _IO_FILE_plus fp;
#ifdef _IO_MTSAFE_IO
  _IO_lock_t lock;
#endif
  struct _IO_wide_data wd;
} *new_f;

struct _IO_FILE_plus
{
  _IO_FILE file;
  const struct _IO_jump_t *vtable;
};

As you can see, &new_f->fp.file; is the same as (_IO_FILE *) new_f.

Even if it was some struct in the middle of the outer struct, you could still
using offsetof get back to the original malloced pointer.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=2077

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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