Commit aa4f40fe authored by Gen Zhang's avatar Gen Zhang Committed by Xie XiuQi
Browse files

consolemap: Fix a memory leaking bug in drivers/tty/vt/consolemap.c



mainline inclusion
from mainline-5.3
commit 84ecc2f6
category: bugfix
bugzilla: 13690
CVE: CVE-2019-12379

-------------------------------------------------

In function con_insert_unipair(), when allocation for p2 and p1[n]
fails, ENOMEM is returned, but previously allocated p1 is not freed,
remains as leaking memory. Thus we should free p1 as well when this
allocation fails.

Signed-off-by: default avatarGen Zhang <blackgod016574@gmail.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 7d3fd1ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment