Skip to content

use-after-free bug in diff.c #457

@garious

Description

@garious

I'm seeing a use-after-free bug when accessing a Patch object after its Diff had been garbage-collected. Valgrind confirms.

The quick fix is to strdup() old_file.path and new_file.path (and free in Patch_dealloc). Better would be to skip the mallocs and piggyback the git_patch* onto the Patch object and move git_patch_free() to Patch_dealloc. Thoughts?

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