All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd: do not leak image_id in rbd_dev_v2_parent_info()
@ 2014-06-30  9:45 Ilya Dryomov
  2014-07-07 22:40 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Dryomov @ 2014-06-30  9:45 UTC (permalink / raw)
  To: ceph-devel

image_id is leaked if the parent happens to have been recorded already.
Fix it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
---
 drivers/block/rbd.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d99aa81774f8..adedb393b374 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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);
 	}
 
 	/*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-07 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30  9:45 [PATCH] rbd: do not leak image_id in rbd_dev_v2_parent_info() Ilya Dryomov
2014-07-07 22:40 ` Alex Elder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.