]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1248106 2324/head
authorSimos Xenitellis <simos.lists@googlemail.com>
Tue, 15 May 2018 00:05:13 +0000 (00:05 +0000)
committerSimos Xenitellis <simos.lists@googlemail.com>
Tue, 15 May 2018 11:05:54 +0000 (11:05 +0000)
Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
src/lxc/network.c

index a7e05280dc1385b66f103b24ed4d4ce3a58a47d3..835a1fb690dd2548fa64e09ebee8f74e85dbbec3 100644 (file)
@@ -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) {