Merge pull request #697 from nalind/image-free

Don't double-free an UnparsedSource
This commit is contained in:
Mrunal Patel 2017-07-26 17:35:39 -07:00 committed by GitHub
commit f8a822e900

View file

@ -137,10 +137,9 @@ func (svc *imageService) CanPull(imageName string, options *copy.Options) (bool,
if err != nil {
return false, err
}
unparsedImage := image.UnparsedFromSource(rawSource)
defer unparsedImage.Close()
src, err := image.FromUnparsedImage(unparsedImage)
src, err := image.FromSource(rawSource)
if err != nil {
rawSource.Close()
return false, err
}
src.Close()