diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-30 01:13:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-30 01:13:25 +0000 |
commit | 578a5b53effeb6598a668940864c5c4a5e8b8e8f (patch) | |
tree | 9ad719ef01b6d70c7ec6f18c543826f865905111 /lib/libc/stdio/fvwrite.c | |
parent | 4def20ebc9c99744f26b8aad409fd752a52db532 (diff) |
Deal with realloc() failure in v?asprintf()
Diffstat (limited to 'lib/libc/stdio/fvwrite.c')
-rw-r--r-- | lib/libc/stdio/fvwrite.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c index c01968b72f8..bc73dbb8743 100644 --- a/lib/libc/stdio/fvwrite.c +++ b/lib/libc/stdio/fvwrite.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.5 1997/11/29 19:54:48 millert Exp $"; +static char rcsid[] = "$OpenBSD: fvwrite.c,v 1.6 1997/11/30 01:13:24 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -120,9 +120,10 @@ __sfvwrite(fp, uio) */ fp->_w = len + 128; fp->_bf._size = blen + len + 128; - /* XXX - check return val */ fp->_bf._base = realloc(fp->_bf._base, fp->_bf._size + 1); + if (fp->_bf._base == NULL) + goto err; fp->_p = fp->_bf._base + blen; } w = fp->_w; |