Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
This commit is contained in:
Simos Xenitellis 2018-05-15 00:05:13 +00:00
parent 9ab207cad7
commit 7d1cde93be

View 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) {