diff options
author | das <das@FreeBSD.org> | 2008-06-29 22:54:26 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2008-06-29 22:54:26 +0000 |
commit | 68710b09906506ec69fe3b6af8f18df4227fb2b0 (patch) | |
tree | 0ea254ca1f45c1de7d502552b791ca46b755720d /lib/libc/stdio/vfwprintf.c | |
parent | 38f0d9da85f23811214100583dc24ca524660906 (diff) | |
download | FreeBSD-src-68710b09906506ec69fe3b6af8f18df4227fb2b0.zip FreeBSD-src-68710b09906506ec69fe3b6af8f18df4227fb2b0.tar.gz |
Correctly handle malloc() failure. While here, reduce the code size a
bit by removing some calls to the inline function addtype().
Diffstat (limited to 'lib/libc/stdio/vfwprintf.c')
-rw-r--r-- | lib/libc/stdio/vfwprintf.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index eb51c6d..6b4e9b1 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -559,7 +559,10 @@ __vfwprintf(FILE *fp, const wchar_t *fmt0, va_list ap) int hold = nextarg; \ if (argtable == NULL) { \ argtable = statargtable; \ - __find_warguments (fmt0, orgap, &argtable); \ + if (__find_warguments (fmt0, orgap, &argtable)) { \ + ret = EOF; \ + goto error; \ + } \ } \ nextarg = n2; \ val = GETARG (int); \ @@ -683,8 +686,11 @@ reswitch: switch (ch) { nextarg = n; if (argtable == NULL) { argtable = statargtable; - __find_warguments (fmt0, orgap, - &argtable); + if (__find_warguments (fmt0, orgap, + &argtable)) { + ret = EOF; + goto error; + } } goto rflag; } |