mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-01 18:53:08 +01:00
unetmsg: add null check in TX disconnect callback
The network may be deleted before the disconnect callback fires. Check for null to avoid crash when accessing net.tx_channels. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
f5bf8c2b94
commit
f631d1576d
1 changed files with 5 additions and 0 deletions
|
|
@ -350,6 +350,11 @@ function network_open_channel(net, name, peer)
|
|||
|
||||
let disconnect_cb = (req) => {
|
||||
let net = networks[sock_data.network];
|
||||
if (!net) {
|
||||
network_tx_socket_close(sock_data);
|
||||
return;
|
||||
}
|
||||
|
||||
let cur_data = net.tx_channels[sock_data.name];
|
||||
if (cur_data == sock_data)
|
||||
delete net.tx_channels[sock_data.name];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue