public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/18820] New: fmemopen may leak memory on failure
@ 2015-08-13  3:31 ppluzhnikov at google dot com
  2015-08-13  3:31 ` [Bug stdio/18820] " ppluzhnikov at google dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ppluzhnikov at google dot com @ 2015-08-13  3:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18820

            Bug ID: 18820
           Summary: fmemopen may leak memory on failure
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: ppluzhnikov at google dot com
  Target Milestone: ---

While fixing PR 18757, I noticed that fmemopen leaks memory via the following
path:

FILE *
__fmemopen (void *buf, size_t len, const char *mode)
{
  cookie_io_functions_t iof;
  fmemopen_cookie_t *c;

  c = (fmemopen_cookie_t *) calloc (sizeof (fmemopen_cookie_t), 1);
  ...

  return _IO_fopencookie (c, mode, iof);
}

If _IO_fopencookie() fails and returns NULL, we leak.

The fix for both issues was here:
https://sourceware.org/ml/libc-alpha/2015-08/msg00315.html
but it needs more work.

I might as well separate the issues.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug stdio/18820] fmemopen may leak memory on failure
  2015-08-13  3:31 [Bug stdio/18820] New: fmemopen may leak memory on failure ppluzhnikov at google dot com
@ 2015-08-13  3:31 ` ppluzhnikov at google dot com
  2015-08-13  6:55 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ppluzhnikov at google dot com @ 2015-08-13  3:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18820

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |ppluzhnikov at google dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug stdio/18820] fmemopen may leak memory on failure
  2015-08-13  3:31 [Bug stdio/18820] New: fmemopen may leak memory on failure ppluzhnikov at google dot com
  2015-08-13  3:31 ` [Bug stdio/18820] " ppluzhnikov at google dot com
@ 2015-08-13  6:55 ` cvs-commit at gcc dot gnu.org
  2015-08-13  7:00 ` ppluzhnikov at google dot com
  2015-10-29 17:04 ` jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-13  6:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18820

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  63e952d9be87db68f0e4164d4a5760b32e77ebff (commit)
      from  8a29509dd9aa179bfe4ef96d49d72f6816ec878f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=63e952d9be87db68f0e4164d4a5760b32e77ebff

commit 63e952d9be87db68f0e4164d4a5760b32e77ebff
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Wed Aug 12 23:51:04 2015 -0700

    Fix BZ #18820 -- fmemopen may leak memory on failure.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    8 ++++++++
 NEWS                  |    2 +-
 libio/Makefile        |    8 +++++++-
 libio/fmemopen.c      |   12 +++++++++++-
 libio/oldfmemopen.c   |   12 +++++++++++-
 libio/test-fmemopen.c |   30 +++++++++++++++++++++++++++++-
 6 files changed, 67 insertions(+), 5 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug stdio/18820] fmemopen may leak memory on failure
  2015-08-13  3:31 [Bug stdio/18820] New: fmemopen may leak memory on failure ppluzhnikov at google dot com
  2015-08-13  3:31 ` [Bug stdio/18820] " ppluzhnikov at google dot com
  2015-08-13  6:55 ` cvs-commit at gcc dot gnu.org
@ 2015-08-13  7:00 ` ppluzhnikov at google dot com
  2015-10-29 17:04 ` jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ppluzhnikov at google dot com @ 2015-08-13  7:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18820

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

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

--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Fixed on master.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug stdio/18820] fmemopen may leak memory on failure
  2015-08-13  3:31 [Bug stdio/18820] New: fmemopen may leak memory on failure ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2015-08-13  7:00 ` ppluzhnikov at google dot com
@ 2015-10-29 17:04 ` jsm28 at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-10-29 17:04 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18820

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.23

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-29 17:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13  3:31 [Bug stdio/18820] New: fmemopen may leak memory on failure ppluzhnikov at google dot com
2015-08-13  3:31 ` [Bug stdio/18820] " ppluzhnikov at google dot com
2015-08-13  6:55 ` cvs-commit at gcc dot gnu.org
2015-08-13  7:00 ` ppluzhnikov at google dot com
2015-10-29 17:04 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).