diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-23 10:22:09 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-23 10:22:09 +0100 |
commit | 6dd7c4fb573bb51729560b700d4e837ce2b32fdb (patch) | |
tree | 7d88f245ed9c41fa6c9ddc78d52b6fe84f475848 /src/common/oml.c | |
parent | bb9647f65108cd2f4f961306b1b4b8354e2d49bb (diff) |
misc: Check return value of msgb _alloc functions
Attempt to catch all functions that allocate a msgb and didn't
check the return value of the allocation.
Diffstat (limited to 'src/common/oml.c')
-rw-r--r-- | src/common/oml.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index a7bcc407..f6eaec75 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -288,10 +288,14 @@ int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause) { struct abis_om_hdr *old_oh = msgb_l2(old_msg); struct abis_om_fom_hdr *old_foh = msgb_l3(old_msg); - struct msgb *msg = oml_msgb_alloc(); + struct msgb *msg; struct abis_om_fom_hdr *foh; int is_manuf = 0; + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + /* make sure to respond with MANUF if request was MANUF */ if (old_oh->mdisc == ABIS_OM_MDISC_MANUF) is_manuf = 1; |