diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-04-07 03:17:39 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-04-07 03:17:39 +0000 |
| commit | 6f098a4811a9140076f797e55962e535e4a164d0 (patch) | |
| tree | 3b7eabc52d0208f30ce18cfed716b0dd94a7601f /lib/libc/stdio/vfprintf.c | |
| parent | acdf797d1a98cb45c9ce0dc4cb27ff7930cc49eb (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
| -rw-r--r-- | lib/libc/stdio/vfprintf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 826ea288c4b0..8ca5ac424a12 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -384,9 +384,11 @@ __wcsconv(wchar_t *wcsarg, int prec) break; mbp += clen; } - *mbp = '\0'; - if (clen == (size_t)-1) + if (clen == (size_t)-1) { + free(convbuf); return (NULL); + } + *mbp = '\0'; return (convbuf); } |
