[OpenWrt-Devel] [PATCH netifd 02/16] vlan: Fix possible segfault

Hans Dedecker dedeckeh at gmail.com
Mon Feb 1 04:56:16 EST 2016


Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 vlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlan.c b/vlan.c
index 8e7141f..ac434ce 100644
--- a/vlan.c
+++ b/vlan.c
@@ -120,6 +120,8 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create)
 	D(DEVICE, "Create vlan device '%s.%d'\n", dev->ifname, id);
 
 	vldev = calloc(1, sizeof(*vldev));
+	if (!vldev)
+		return NULL;
 
 	vldev->id = id;
 	vlan_dev_set_name(vldev, dev);
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list