diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-09-16 09:16:11 -0700 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-09-16 09:16:11 -0700 |
commit | 560b04462f899e76a0062ec89422caa6e94fd67f (patch) | |
tree | 00c0a46a7eb71c9443bbe77bd2dcff14c091e9cf /stdio-common/vfprintf.c | |
parent | 1f60740e5f03823a557d1543cf08880a11d719de (diff) | |
download | glibc-560b04462f899e76a0062ec89422caa6e94fd67f.tar.gz glibc-560b04462f899e76a0062ec89422caa6e94fd67f.tar.xz glibc-560b04462f899e76a0062ec89422caa6e94fd67f.zip |
Fix BZ #18872 -- memory leak in printf_positional.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r-- | stdio-common/vfprintf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index 4b1bb8feb5..5e408d2961 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; |