aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2015-09-16 09:16:11 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2015-09-16 09:16:11 -0700
commit560b04462f899e76a0062ec89422caa6e94fd67f (patch)
tree00c0a46a7eb71c9443bbe77bd2dcff14c091e9cf /stdio-common/vfprintf.c
parent1f60740e5f03823a557d1543cf08880a11d719de (diff)
downloadglibc-560b04462f899e76a0062ec89422caa6e94fd67f.zip
glibc-560b04462f899e76a0062ec89422caa6e94fd67f.tar.gz
glibc-560b04462f899e76a0062ec89422caa6e94fd67f.tar.bz2
Fix BZ #18872 -- memory leak in printf_positional.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 4b1bb8f..5e408d2 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -2091,6 +2091,10 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
- specs[nspecs_done].end_of_fmt);
}
all_done:
+ if (__glibc_unlikely (specs_malloced))
+ free (specs);
+ if (__glibc_unlikely (args_malloced != NULL))
+ free (args_malloced);
if (__glibc_unlikely (workstart != NULL))
free (workstart);
return done;