From 11797342f8ab344850893a3857210d1cd0fbd285 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 1 Feb 2016 10:56:16 +0100 Subject: [PATCH] vlan: Fix possible segfault Signed-off-by: Hans Dedecker --- 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); -- 2.25.1