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-25 15:02:05 +0200
commit68399ea77e586474a228897b20ca889bf371b307 (patch)
treec4470d9c97f555364ee9db0a6ee72cff429af204
parenteabdf759363dae0162f2ff8477e64ead599a12ff (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 b433d50ca..45b8e3323 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);