Skip to content

Need to keep string's lifetime when using set-param functions #855

@DreamHelium

Description

@DreamHelium

I was used to using the dynamic string in my project, so when calling functions like mz_zip_reader_set_pattern, I couldn't free the string after calling such functions, which must cause a segfault. Keeping the lifetime of such string in function's lifetime might be hard since one can forget to free such string.
Since freeing a NULL pointer is safe, it is possible to make strings in structure dynamically assigned and then freed at last.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions