mirror of https://github.com/xemu-project/xemu.git
l2cap: fix access to freed memory
Pointer 'ch' will be used in function 'l2cap_channel_open_req_msg' after it was previously freed in 'l2cap_channel_open'. Assigned it to NULL after it is freed. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
8945c7f754
commit
2c145d7a73
|
@ -429,7 +429,7 @@ static struct l2cap_chan_s *l2cap_channel_open(struct l2cap_instance_s *l2cap,
|
|||
status = L2CAP_CS_NO_INFO;
|
||||
} else {
|
||||
g_free(ch);
|
||||
|
||||
ch = NULL;
|
||||
result = L2CAP_CR_NO_MEM;
|
||||
status = L2CAP_CS_NO_INFO;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue