public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nss/31936] New: memory leaks in fget*ent.c
@ 2024-06-27 20:48 dj at redhat dot com
  0 siblings, 0 replies; only message in thread
From: dj at redhat dot com @ 2024-06-27 20:48 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 31936
           Summary: memory leaks in fget*ent.c
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nss
          Assignee: unassigned at sourceware dot org
          Reporter: dj at redhat dot com
  Target Milestone: ---

in nss/fgetgrent.c, fgetpwent.c, fgetsgent.c, and fgetspent.c, there's code
like this:

      new_buf = realloc (buffer, buffer_size);
      if (new_buf == NULL)
        {
          . . .
        }
      buffer = new_buf;

      /* Reset the stream.  */
      if (fsetpos (stream, &pos) != 0)
        buffer = NULL;

In all four files, if realloc() succeeds but fsetpos() fails, the memory
"buffer" points to is leaked.

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-27 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27 20:48 [Bug nss/31936] New: memory leaks in fget*ent.c dj at redhat dot com

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).