virtio: fix coverity warnings 85/9685/2
authorSteven <sluong@cisco.com>
Fri, 1 Dec 2017 00:56:54 +0000 (16:56 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 1 Dec 2017 11:14:52 +0000 (11:14 +0000)
commitf953dfc8e01426ce93588e9013c112e48a9a8463
treedd5e7eb09511df669dc9bec6a1cbf0300df3c344
parent088f0e221c05b7b1cd59b61442eaf595e22e2fef
virtio: fix coverity warnings

Fix 3 coverity warnings
1. api_format.c: init net_ns = 0 and remove its corresponding vec_add and
vec_free
2. netlink.c (reported in tap.c before the code was removed): resource leaked
due to fd is not close
3. tap.c: subtract 1 for size when calling strncpy to accommodate the
terminated NULL character

Change-Id: Iff4e66604862f0c06dac227b8cfd48d3979e41a5
Signed-off-by: Steven <sluong@cisco.com>
src/vat/api_format.c
src/vnet/devices/netlink.c
src/vnet/devices/virtio/tap.c