diff options
author | Esa Peuha <esa.peuha@gmail.com> | 2016-02-27 09:59:13 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-02-28 10:40:31 +0100 |
commit | 9019d6fc527882b8e09ca210e997b43a7b77c70f (patch) | |
tree | 30c3f60c07f43846cee5f3dda83f6a7314eefc85 /libps | |
parent | 6e8e837864d4e24c2fdb4d90e8eb262ded78c3a8 (diff) |
Fix use-after-free in libps.
* libps/fmt.c (_fmt_create): Free new_fmt->src before new_fmt
if reallocating fields fails.
Diffstat (limited to 'libps')
-rw-r--r-- | libps/fmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libps/fmt.c b/libps/fmt.c index 580b097e..f9142123 100644 --- a/libps/fmt.c +++ b/libps/fmt.c @@ -80,8 +80,8 @@ _fmt_create (char *src, int posix, struct ps_fmt_specs *fmt_specs, if (fields == NULL) { - FREE (new_fmt); FREE (new_fmt->src); + FREE (new_fmt); return ENOMEM; } |