Commit ee54ea9a by Wim Coekaerts Committed by Stéphane Graber

network.c:is_wlan() File Leak f

network.c:is_wlan() File Leak f f initialized at line 156 with fopen f leaks when fopen(path, r) != NULL at line 156 and physname == NULL at line 163. Signed-off-by: 's avatarWim Coekaerts <wim.coekaerts@oracle.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent a90277df
......@@ -158,8 +158,10 @@ static char * is_wlan(const char *ifname)
physlen = ftell(f);
fseek(f, 0, SEEK_SET);
physname = malloc(physlen+1);
if (!physname)
if (!physname) {
fclose(f);
goto bad;
}
memset(physname, 0, physlen+1);
ret = fread(physname, 1, physlen, f);
fclose(f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment