summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2008-06-29 22:54:26 +0000
committerdas <das@FreeBSD.org>2008-06-29 22:54:26 +0000
commit68710b09906506ec69fe3b6af8f18df4227fb2b0 (patch)
tree0ea254ca1f45c1de7d502552b791ca46b755720d /lib/libc/stdio/vfprintf.c
parent38f0d9da85f23811214100583dc24ca524660906 (diff)
downloadFreeBSD-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/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 2790547..3f98c63 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -555,7 +555,10 @@ __vfprintf(FILE *fp, const char *fmt0, va_list ap)
int hold = nextarg; \
if (argtable == NULL) { \
argtable = statargtable; \
- __find_arguments (fmt0, orgap, &argtable); \
+ if (__find_arguments (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_arguments (fmt0, orgap,
- &argtable);
+ if (__find_arguments (fmt0, orgap,
+ &argtable)) {
+ ret = EOF;
+ goto error;
+ }
}
goto rflag;
}
OpenPOWER on IntegriCloud