From: Simos Xenitellis Date: Tue, 15 May 2018 00:05:13 +0000 (+0000) Subject: coverity: #1248106 X-Git-Tag: lxc-3.1.0~300^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2324%2Fhead;p=thirdparty%2Flxc.git coverity: #1248106 Resource leak Signed-off-by: Simos Xenitellis --- 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) {