From 7d1cde93be367087b7e55554f71bd70ad15a22d8 Mon Sep 17 00:00:00 2001 From: Simos Xenitellis Date: Tue, 15 May 2018 00:05:13 +0000 Subject: [PATCH] coverity: #1248106 Resource leak Signed-off-by: Simos Xenitellis --- src/lxc/network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/network.c b/src/lxc/network.c index a7e05280d..835a1fb69 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -591,8 +591,10 @@ static char *is_wlan(const char *ifname) fseek(f, 0, SEEK_END); physlen = ftell(f); fseek(f, 0, SEEK_SET); - if (physlen < 0) + if (physlen < 0) { + fclose(f); goto bad; + } physname = malloc(physlen + 1); if (!physname) { -- 2.47.2