rbd: in TestRemoveImage ensure options are destroyed

The resources of the rbd image options must be cleaned up or we leak.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-01-30 13:36:56 -05:00 committed by John Mulligan
parent fc29c7f30a
commit 1842bd74e6
1 changed files with 3 additions and 1 deletions

View File

@ -1332,7 +1332,9 @@ func TestRemoveImage(t *testing.T) {
// create and then remove an image // create and then remove an image
name := GetUUID() name := GetUUID()
err = CreateImage(ioctx, name, testImageSize, NewRbdImageOptions()) options := NewRbdImageOptions()
defer options.Destroy()
err = CreateImage(ioctx, name, testImageSize, options)
assert.NoError(t, err) assert.NoError(t, err)
imageNames, err := GetImageNames(ioctx) imageNames, err := GetImageNames(ioctx)