summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-27 11:50:51 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-27 11:50:51 +0200
commit48c72f1f5c8f07cd6c7cb3558e9249f20aefb108 (patch)
treeeea528fd66ec1a794572e69f7df1ff8a25f82462
parent4c880a02f4186406a53ce7fa28b061ce3a0d3955 (diff)
deliver_to_mtp_user(): Fix null pointer dereference
We had used + derefernced the 'prim' pointer before checking its validity. Change-Id: I0ca5026091e91926924b297f9342bda5f9fd38c9 Fixes: coverity CID#166946
-rw-r--r--src/osmo_ss7_hmrt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c
index bbbb3a9..393530a 100644
--- a/src/osmo_ss7_hmrt.c
+++ b/src/osmo_ss7_hmrt.c
@@ -67,9 +67,9 @@ static int deliver_to_mtp_user(const struct osmo_ss7_user *osu,
/* Create MTP-TRANSFER.ind and feed to user */
prim = m3ua_to_xfer_ind(xua);
- prim->u.transfer = xua->mtp;
if (!prim)
return -1;
+ prim->u.transfer = xua->mtp;
return osu->prim_cb(&prim->oph, (void *) osu->priv);
}