Skip to content

Commit fbba11b

Browse files
committed
rbd: do not leak image_id in rbd_dev_v2_parent_info()
image_id is leaked if the parent happens to have been recorded already. Fix it. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
1 parent 494d77b commit fbba11b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/block/rbd.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,6 +4072,8 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
40724072
parent_spec->snap_id = snap_id;
40734073
rbd_dev->parent_spec = parent_spec;
40744074
parent_spec = NULL; /* rbd_dev now owns this */
4075+
} else {
4076+
kfree(image_id);
40754077
}
40764078

40774079
/*

0 commit comments

Comments
 (0)