summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2003-04-07 03:17:39 +0000
committerache <ache@FreeBSD.org>2003-04-07 03:17:39 +0000
commitc0bef0ac8aeac2c3db982e3be42801986705b1a0 (patch)
tree3b7eabc52d0208f30ce18cfed716b0dd94a7601f /lib/libc/stdio
parentcfb316d8d0b5751259ac1d59c70a562fcfe018e8 (diff)
downloadFreeBSD-src-c0bef0ac8aeac2c3db982e3be42801986705b1a0.zip
FreeBSD-src-c0bef0ac8aeac2c3db982e3be42801986705b1a0.tar.gz
__wcsconv(): free(convbuf) before returning NULL
Diffstat (limited to 'lib/libc/stdio')
-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 826ea28..8ca5ac4 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);
}
OpenPOWER on IntegriCloud