mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-29 13:15:05 +00:00
bhyve: Fix a leak that happens when we fail to load a hostfwd rule
Reported by: Coverity Fixes:c5359e2af5
("bhyve: Add a slirp network backend") (cherry picked from commit1cc96501e5
)
This commit is contained in:
parent
8b6d3fb0a7
commit
37eb7030a0
|
@ -502,8 +502,10 @@ _slirp_init(struct net_backend *be, const char *devname __unused,
|
|||
goto err;
|
||||
while ((rule = strsep(&rules, ";")) != NULL) {
|
||||
error = config_one_hostfwd(priv, rule);
|
||||
if (error != 0)
|
||||
if (error != 0) {
|
||||
free(tofree);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
free(tofree);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue