From 3363db5c909ce9222108728d9ac9c9c095099a1e Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 17 Dec 2021 13:35:36 +0100 Subject: [PATCH] llsk_gtp: Early return if conn alloc fails Change-Id: Iaf597b76ceb9cce3f27c42625f963f740c8f213e --- src/osmo-hnodeb/llsk_gtp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osmo-hnodeb/llsk_gtp.c b/src/osmo-hnodeb/llsk_gtp.c index 30451a0..a224d56 100644 --- a/src/osmo-hnodeb/llsk_gtp.c +++ b/src/osmo-hnodeb/llsk_gtp.c @@ -169,6 +169,9 @@ static int llsk_rx_gtp_conn_establish_req(struct hnb *hnb, struct hnb_gtp_conn_e /* Create the socket: */ conn = gtp_conn_alloc(ue); + if (!conn) + return _send_conn_establish_cnf_failed(hnb, ce_req->context_id, 4); + if ((rc = gtp_conn_setup(conn, &rem_osa, ce_req->remote_tei)) < 0) { LOGUE(ue, DLLSK, LOGL_ERROR, "Rx GTP-CONN_ESTABLISH.req: Failed to set up gtp socket rem_tei=%u rem_addr=%s\n", ce_req->remote_tei, rem_addrstr);