tun: Check for xmalloc error

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2013-08-28 17:20:44 +04:00 committed by Pavel Emelyanov
parent 20a835a686
commit aaeff46e52

2
tun.c
View file

@ -121,6 +121,8 @@ static struct tun_link *__dump_tun_link_fd(int fd, char *name, unsigned flags)
struct sock_fprog flt;
tl = xmalloc(sizeof(*tl));
if (!tl)
goto err;
strcpy(tl->name, name);
if (ioctl(fd, TUNGETVNETHDRSZ, &tl->dmp.vnethdr) < 0) {