summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-27 12:24:38 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-27 12:24:38 +0200
commitfa3325fb8b2f8bf31593b24e4e50693916feef1e (patch)
tree633a12c08b43868ddb496b244fb0a047a49928ca
parent982c0ce33787443cdef9f342eb5fac30e806cd8e (diff)
osmo_ss7_user_unregister(): Don't dereference NULL user
The 'user' argument to osmo_ss7_user_unregister() can be NULL, so let's make sure we don't dereference it. Change-Id: Ia34b181dcbcb179b2639e2f405364cc952069842 Fixes: coverity CID#166933
-rw-r--r--src/osmo_ss7.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 31c0dc5..d952ecd 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -442,7 +442,8 @@ int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind
if (user && (inst->user[service_ind] != user))
return -EINVAL;
- user->inst = NULL;
+ if (user)
+ user->inst = NULL;
inst->user[service_ind] = NULL;
return 0;