[bsc-nat] ctrlif: use the 'err' label consistently

and propagate -ENOMEM in case we have no memory
This commit is contained in:
Harald Welte 2011-07-13 14:45:21 +02:00
parent f8e49dd187
commit 6552047d44
1 changed files with 2 additions and 4 deletions

View File

@ -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) {