]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsfd: fix use-after-free and resource leak [coverity scan]
authorKarel Zak <kzak@redhat.com>
Mon, 29 Nov 2021 12:41:36 +0000 (13:41 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Nov 2021 12:41:36 +0000 (13:41 +0100)
commitf22ef0fefd6fc5cd1c0c8cf8cc9ab129ed58c4aa
tree5214818ec2e1e4292c5efe9eb21175d9635385a5
parent49fe65af3a876520cf025058c3adfdf149c4461a
lsfd: fix use-after-free and resource leak [coverity scan]

>>>     CID 374363:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>     Dereferencing freed pointer "t".
764                             snprintf(parser->errmsg, ERRMSG_LEN,
765                                      _("error: unsupported column data type: %d, column: %s"),
766                                      jtype, t->val.str);

856             default:
857                     warnx("unexpected token type: %d", t->type);
>>>     CID 374360:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "t" going out of scope leaks the storage it points to.
858                     return NULL;

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsfd-filter.c