]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
nbd: prevent memory leak
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Mon, 23 Sep 2019 20:09:58 +0000 (15:09 -0500)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Nov 2019 18:33:41 +0000 (11:33 -0700)
commit03bf73c315edca28f47451913177e14cd040a216
treebe6c1803a0475f2654db1dba73c30581d2a4a319
parent866ca95da5e5c4fad59f1b08254168284bd6a911
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: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c