aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-25 09:16:30 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2011-08-26 12:30:19 +0200
commit774c62614aa1c033416b74b0ad7ec897bc58256d (patch)
treebdf94121c3600f93f07caa87bb7a521ae48347ad
parentfde015a7797714a6cc88825b03750a0134159a89 (diff)
bsc: Add a null check and return early
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_ctrl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index cace0c83b..43d97e6c3 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -42,6 +42,11 @@ void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_connection *msc_con
ctrl = msc_data->network->ctrl;
trap = ctrl_cmd_trap(cmd);
+ if (!trap) {
+ LOGP(DCTRL, LOGL_ERROR, "Failed to create trap.\n");
+ return;
+ }
+
ctrl_cmd_send_to_all(ctrl, trap);
ctrl_cmd_send(&msc_con->write_queue, trap);