nl80211: fix possible fd leak in nl80211_hostapd_hup()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
eeaae3d011
commit
b19476dec2
1 changed files with 1 additions and 1 deletions
|
@ -951,7 +951,7 @@ static void nl80211_hostapd_hup(const char *ifname)
|
||||||
if (phy)
|
if (phy)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "/var/run/wifi-%s.pid", phy);
|
snprintf(buf, sizeof(buf), "/var/run/wifi-%s.pid", phy);
|
||||||
if ((fd = open(buf, O_RDONLY)) > 0)
|
if ((fd = open(buf, O_RDONLY)) >= 0)
|
||||||
{
|
{
|
||||||
if (read(fd, buf, sizeof(buf)) > 0)
|
if (read(fd, buf, sizeof(buf)) > 0)
|
||||||
pid = atoi(buf);
|
pid = atoi(buf);
|
||||||
|
|
Loading…
Reference in a new issue