fd will be leaked if launch_script failed.
Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
Coverity-ID:
1055925
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
if (!setup_script || !strcmp(setup_script, "no"))
setup_script = "";
if (setup_script[0] != '\0') {
- if (launch_script(setup_script, ifname, script_arg, fd))
+ if (launch_script(setup_script, ifname, script_arg, fd)) {
+ close(fd);
return -1;
+ }
}
s = net_tap_fd_init(vlan, model, name, fd);
if (!s)