Add missing file close. Signed-off-by: Zhang Shengju <zhangshen...@cmss.chinamobile.com> --- ip/ipnetns.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/ip/ipnetns.c b/ip/ipnetns.c index 088096f..d1af0c6 100644 --- a/ip/ipnetns.c +++ b/ip/ipnetns.c @@ -462,8 +462,10 @@ static int netns_pids(int argc, char **argv) if (fstat(netns, &netst) < 0) { fprintf(stderr, "Stat of netns failed: %s\n", strerror(errno)); + close(netns); return -1; } + close(netns); dir = opendir("/proc/"); if (!dir) { fprintf(stderr, "Open of /proc failed: %s\n", @@ -522,8 +524,10 @@ static int netns_identify(int argc, char **argv) if (fstat(netns, &netst) < 0) { fprintf(stderr, "Stat of netns failed: %s\n", strerror(errno)); + close(netns); return -1; } + close(netns); dir = opendir(NETNS_RUN_DIR); if (!dir) { /* Succeed treat a missing directory as an empty directory */ @@ -728,6 +732,7 @@ static int netns_set(int argc, char **argv) name, strerror(errno)); return -1; } + close(netns); return set_netnsid_from_name(name, nsid); } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html