summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2003-04-07 03:17:39 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2003-04-07 03:17:39 +0000
commit6f098a4811a9140076f797e55962e535e4a164d0 (patch)
tree3b7eabc52d0208f30ce18cfed716b0dd94a7601f /lib/libc/stdio/vfprintf.c
parentacdf797d1a98cb45c9ce0dc4cb27ff7930cc49eb (diff)
Notes
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c6
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);
}