diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-13 14:45:21 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-13 14:53:16 +0200 |
commit | 6552047d44bf22c6ce6668875d7921729ec623f3 (patch) | |
tree | de8ef3e0430966359b02288c02b602716e386842 /openbsc | |
parent | f8e49dd187ec9ad55b133dcd15f4b1b4343da1a5 (diff) |
[bsc-nat] ctrlif: use the 'err' label consistently
and propagate -ENOMEM in case we have no memory
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 2cbb7dc0f..f39856ec1 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1195,14 +1195,12 @@ static int handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) cmd = talloc_zero(bsc, struct ctrl_cmd); if (!cmd) { LOGP(DNAT, LOGL_ERROR, "OOM!\n"); - return 0; + return -ENOMEM; } cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Failed to parse command."; - ctrl_cmd_send(&bsc->write_queue, cmd); - talloc_free(cmd); - return 0; + goto err; } if (bsc->cfg) { |