Skip to content
Commit 03bf73c3 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Jens Axboe
Browse files

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: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 866ca95d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment