linux-platform: fix a file descriptor leak
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 21 Jan 2016 15:31:29 +0000 (16:31 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Thu, 21 Jan 2016 15:32:23 +0000 (16:32 +0100)
Coverity: CID 59384 (#3-1 of 3): Resource leak (RESOURCE_LEAK)26.
leaked_handle: Handle variable fd going out of scope leaks the handle

src/platform/nm-linux-platform.c

index f516680..2ea9360 100644 (file)
@@ -4827,6 +4827,7 @@ tun_add (NMPlatform *platform, const char *name, gboolean tap,
        if (out_link)
                *out_link = obj ? &obj->link : NULL;
 
+       close (fd);
        return !!obj;
 }