diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2013-11-29 15:22:34 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-11-29 15:33:44 +0100 |
commit | edeaec0b8752bbadeb5b94c2b238e07dc4a1b4e4 (patch) | |
tree | bfb6770241b60e49a0caf633b30f4d6e968817f0 /bridge.c | |
parent | fbb4a83633fd935748dd3c26d4fc28821db71cdd (diff) |
netifd: Fix possible segfault in bridge code
Need to check calloc result. In case of failure the bridge member will be missing.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Diffstat (limited to 'bridge.c')
-rw-r--r-- | bridge.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -318,6 +318,9 @@ bridge_create_member(struct bridge_state *bst, struct device *dev, bool hotplug) struct bridge_member *bm; bm = calloc(1, sizeof(*bm) + strlen(dev->ifname) + 1); + if (!bm) + return NULL; + bm->bst = bst; bm->dev.cb = bridge_member_cb; bm->dev.hotplug = hotplug; |