Re: [Qemu-devel] [PATCH] net: Fix memory leak in net_param_nic()

2018-05-01 Thread Jason Wang
On 2018年04月30日 15:26, Thomas Huth wrote: 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. Signed-off-by: Thomas Huth --- net/net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(

Re: [Qemu-devel] [PATCH] net: Fix memory leak in net_param_nic()

2018-04-30 Thread Philippe Mathieu-Daudé
On 04/30/2018 04:26 AM, Thomas Huth wrote: > 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. > > Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé > --- > net/net.c | 6

Re: [Qemu-devel] [PATCH] net: Fix memory leak in net_param_nic()

2018-04-30 Thread Peter Maydell
On 30 April 2018 at 08:26, Thomas Huth wrote: > 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. > > Signed-off-by: Thomas Huth > --- Reviewed-by: Peter Maydell thanks -- PMM

[Qemu-devel] [PATCH] net: Fix memory leak in net_param_nic()

2018-04-30 Thread Thomas Huth
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. Signed-off-by: Thomas Huth --- net/net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c index 29