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>
This commit is contained in:
Ilya Dryomov 2014-06-27 21:46:33 +04:00
parent 494d77bf8f
commit fbba11b3be
1 changed files with 2 additions and 0 deletions

View File

@ -4072,6 +4072,8 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
parent_spec->snap_id = snap_id;
rbd_dev->parent_spec = parent_spec;
parent_spec = NULL; /* rbd_dev now owns this */
} else {
kfree(image_id);
}
/*