net/slirp: fix memory leak
commit b412eb61 introduce 'cmd:' target for guestfwd, and fwd don't be used in this scenario, and will leak memory in true branch with 'cmd:'. Let's allocate memory for fwd variable just in else statement. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: NGonglei <arei.gonglei@huawei.com> Reviewed-by: NJason Wang <jasowang@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Showing
想要评论请 注册 或 登录