net/failsafe: fix missing pclose after popen
authorRaslan Darawsheh <rasland@mellanox.com>
Thu, 3 Aug 2017 13:09:58 +0000 (16:09 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 3 Aug 2017 20:29:53 +0000 (22:29 +0200)
When there is no preferred device, failsafe will always
try to scan for preferred device. And if there is no device
found with the exec option, popen() will get an empty output.
In this case, it was forgotten to close the file descriptor.
It is fixed by closing the file descriptor even if the output is empty.

Coverity issue: 158633
Fixes: a0194d828100 ("net/failsafe: add flexible device definition")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

No differences found