Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
#include <stdbool.h>
#include <errno.h>
#include <strings.h>
+#include <unistd.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
enum id_input id)
{
char *end;
- int fd;
+ int fd = -1;
if (argc < 1 || !*argv[0])
return 1;
return 1;
nla_put_failure:
+ if (fd >= 0)
+ close(fd);
return -ENOBUFS;
}
COMMAND(set, netns, "{ <pid> | name <nsname> }",