aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-19 19:57:05 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-19 20:14:25 +0200
commit169d2783a656d61a1a2a598812b0f44e92091b3a (patch)
tree33113ed9d3fc6e31ed7cbe4c52ccbba5478c38d3
parent9ae91e594c129ddffaf3217da5834bf6d7d822f0 (diff)
channel: abis: ipa-stream-server: fix crash while closing socket
This fixes the crash while closing socket with/without link with a valid IPA unit.
-rw-r--r--src/channel/abis/ipa_stream_server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/channel/abis/ipa_stream_server.c b/src/channel/abis/ipa_stream_server.c
index 21a82f8..b859261 100644
--- a/src/channel/abis/ipa_stream_server.c
+++ b/src/channel/abis/ipa_stream_server.c
@@ -358,6 +358,9 @@ static int read_cb(struct osmo_stream_srv *conn, int type)
msgb_free(msg);
if (unit != NULL)
abis_ipa_put(unit);
+ else
+ osmo_stream_srv_destroy(conn);
+
return 0;
} else if (ret == 0) {
/* link has vanished, dead socket. */
@@ -365,6 +368,8 @@ static int read_cb(struct osmo_stream_srv *conn, int type)
msgb_free(msg);
if (unit != NULL)
abis_ipa_put(unit);
+ else
+ osmo_stream_srv_destroy(conn);
return 0;
}