diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-08-25 09:16:30 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-26 12:30:19 +0200 |
commit | 774c62614aa1c033416b74b0ad7ec897bc58256d (patch) | |
tree | bdf94121c3600f93f07caa87bb7a521ae48347ad /openbsc | |
parent | fde015a7797714a6cc88825b03750a0134159a89 (diff) |
bsc: Add a null check and return early
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_ctrl.c | 5 |
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); |