Skip to content

[image_picker] Fix clang analyzer warnings in iOS platform code #42678

@jmagman

Description

@jmagman

Steps to Reproduce

$ cd packages/image_picker/example/    
$ flutter build ios
$ cd ios
$ /usr/bin/xcodebuild build -workspace Runner.xcworkspace -scheme Runner -configuration Release CODE_SIGN_IDENTITY=- CODE_SIGNING_ALLOWED=NO analyze

Logs

Classes/FLTImagePickerMetaDataUtil.m:45:29: warning: Potential leak of an object stored into 'source'
  CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)imageData, NULL);
                            ^
1 warning generated.

Looks like there's a missing CFRelease(source);

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.p: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions