nbd: prevent memory leak
In nbd_add_socket when krealloc succeeds, if nsock's allocation fail the reallocted memory is leak. The correct behaviour should be assigning the reallocted memory to config->socks right after success. Reviewed-by: NJosef Bacik <josef@toxicpanda.com> Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: NJens Axboe <axboe@kernel.dk>
Showing
想要评论请 注册 或 登录