net: Fix memory leak in net_param_nic()
The early exits in case of errors leak the memory allocated for nd_id. Fix it by using a "goto out" to the cleanup at the end of the function instead. Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
Showing
想要评论请 注册 或 登录