devices: fix crash on invalid interface
Type: fix
A simple "create host-interface name xxx" is enough to trigger the bug:
The interface is not found, and we goto error with apif=NULL
@@ -679,8 +679,11 @@ error:
fd2 = -1;
}
vec_free (host_if_name_dup);
+ if (apif)
+ {
memset (apif, 0, sizeof (*apif));
pool_put (apm->interfaces, apif);
+ }
return ret;
}
