]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Better glibc compatibility for getline/getdelim:
authorDavid Schultz <das@FreeBSD.org>
Sun, 4 Oct 2009 19:43:36 +0000 (19:43 +0000)
committerDavid Schultz <das@FreeBSD.org>
Sun, 4 Oct 2009 19:43:36 +0000 (19:43 +0000)
commit7e817e2a0306e91da5289df797333995c12abc4c
treee0191effc355243819b234f6a389b1647daf95a9
parente67e0775e6f7f349bb1dca6b821a265499b9def8
Better glibc compatibility for getline/getdelim:

- Tolerate applications that pass a NULL pointer for the buffer and
  claim that the capacity of the buffer is nonzero.

- If an application passes in a non-NULL buffer pointer and claims the
  buffer has zero capacity, we should free (well, realloc) it
  anyway. It could have been obtained from malloc(0), so failing to
  free it would be a small memory leak.

MFC After: 2 weeks
Reported by: naddy
PR: ports/138320
lib/libc/stdio/getdelim.c