From b5d0524c39826a72a99a434d73e19b3f4623e65b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 7 Apr 2021 09:55:00 +0200 Subject: [PATCH] cleanup: release resources for rbdImages objects after use Signed-off-by: Niels de Vos --- internal/rbd/clone.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/rbd/clone.go b/internal/rbd/clone.go index 4febc0a24..b4662723a 100644 --- a/internal/rbd/clone.go +++ b/internal/rbd/clone.go @@ -46,7 +46,10 @@ import ( func (rv *rbdVolume) checkCloneImage(ctx context.Context, parentVol *rbdVolume) (bool, error) { // generate temp cloned volume tempClone := rv.generateTempClone() + defer tempClone.Destroy() + snap := &rbdSnapshot{} + defer snap.Destroy() snap.RbdSnapName = rv.RbdImageName snap.Pool = rv.Pool