Skip to content

CWE Rule Mapping: cpp/new-free-mismatch should be mapped to: CWE-762: Mismatched Memory Management Routine #22162

Description

@davewichers

Description of the issue

This rule is defined as follows:

              "name": "cpp/new-free-mismatch",
              "shortDescription": { "text": "Mismatching new/free or malloc/delete" },
              "fullDescription": {
                "text": "An object that was allocated with 'malloc' or 'new' is being freed using a mismatching 'free' or 'delete'."
              } ,... },
              "properties": {
                "tags": [
                  "reliability",
                  "security",
                  "external/cwe/cwe-401"
                ],

CWE-401 is 'Missing Release of Memory after Effective Lifetime', which isn't properly specific. Whereas CWE-762: Mismatched Memory Management Routines is a MUCH better mapping.

Recommended Fix

Change the CWE mapping to CWE-762.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions