sgs_iface: fix nullpointer dereference
The function sgs_tx() is using the sgs connection pointer as context,
even though it has done a check for a nullpointer in the line before.
This is very prone to lead into a segfault when the SGs connection dies.
Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Related: OS#3859
diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 450d552..f64b191 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -301,8 +301,8 @@
msgb_sctp_ppid(msg) = 0;
if (!sgc) {
- LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n",
- sgsap_msg_type_name(msg->data[0]));
+ LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n",
+ sgsap_msg_type_name(msg->data[0]));
msgb_free(msg);
return;
}