Skip to content

SVGEngine.mm: Object leaked: object allocated and stored into 'path' is returned from a function whose name ('CGPathFromSVGPathString') does not contain 'Copy' or 'Create'. #231

@markm68k

Description

@markm68k

CGPathRef CGPathFromSVGPathString(NSString *svgString) {
CGPathRef const path = pathDefinitionParser(svgString).parse();
if(!path) {
NSLog(@"*** Error: Invalid path attribute");
return NULL;
} else
return path;
}

Call to method pathDefinitionParser::parse returns a Core Foundation object of type CGMutablePathRef with a +1 retain count

Assuming path is non-null, object allocated and stored into path will be leaked.

CGPathFromSVGPathString does not contain Copy or Create. This violates the naming convention rules given in the Memory Management Guide for Core Foundation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions