Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Possible memory leak (find into_raw, but no from_raw) #92

@lucky1024

Description

@lucky1024

As we known, we can use into_raw to transfer ownership of a string to a C caller. But we also need use from_raw to retake pointer to free memory.

into_raw/from_raw is a pair, but I only find into_raw in source code, and can not find from_raw. Failure to call from_raw will lead to a memory leak.

https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_raw

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