diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-02-01 10:56:19 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-02-01 11:09:57 +0100 |
commit | cb03623bf254975f3660211580f441d860b27359 (patch) | |
tree | e847629089102f56e0eb2a8400f99fa2c89c51ea /tunnel.c | |
parent | 18aa062d491988d6fa15092b7ed92cc6f9e44b6d (diff) |
tunnel: Fix possible segfault
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'tunnel.c')
-rw-r--r-- | tunnel.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -67,6 +67,9 @@ tunnel_create(const char *name, struct blob_attr *attr) struct device *dev; tun = calloc(1, sizeof(*tun)); + if (!tun) + return NULL; + dev = &tun->dev; device_init(dev, &tunnel_device_type, name); tun->set_state = dev->set_state; |