mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +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")
This commit is contained in:
parent
4b0615e585
commit
1cc96501e5
|
@ -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