aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-25 01:59:16 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-25 02:01:49 +0100
commit756bfca599630ee64393d877343a9034416d20c3 (patch)
tree309ea637337b05faad9e9f8d8b615cd8dad08f7c
parent681be20a8c32331dcb44db2ec0e99294f1eb89ba (diff)
RSL IPA DLCX: Avoid null-pointer dereference
In case a DLCX is issued without any CRCX before, let's handle this gracefully and simply ack the DLCX anyway. Change-Id: I7c5bedccfc5a7cf552a9ce3a2dc712081c7ce177 Closes: OS#2996
-rw-r--r--src/common/rsl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 2d3f0d60..217393d5 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1904,11 +1904,13 @@ static int rsl_rx_ipac_dlcx(struct msgb *msg)
inc_conn_id = 1;
rc = rsl_tx_ipac_dlcx_ack(lchan, inc_conn_id);
- osmo_rtp_socket_log_stats(lchan->abis_ip.rtp_socket, DRTP, LOGL_INFO,
- "Closing RTP socket on DLCX ");
- osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
- lchan->abis_ip.rtp_socket = NULL;
- msgb_queue_flush(&lchan->dl_tch_queue);
+ if (lchan->abis_ip.rtp_socket) {
+ osmo_rtp_socket_log_stats(lchan->abis_ip.rtp_socket, DRTP, LOGL_INFO,
+ "Closing RTP socket on DLCX ");
+ osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
+ lchan->abis_ip.rtp_socket = NULL;
+ msgb_queue_flush(&lchan->dl_tch_queue);
+ }
return rc;
}