mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-05 23:02:50 +00:00
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: Wim Coekaerts <wim.coekaerts@oracle.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
a90277dfb5
commit
ee54ea9a28
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user