Skip to content

Potential memory leak with sqlite3_expanded_sql? #22

@burdiyan

Description

@burdiyan

According to the docs strings returned by sqlite3_expanded_sql should be freed manually with sqlite3_free:

https://www.sqlite.org/c3ref/expanded_sql.html

The string returned by sqlite3_expanded_sql(P), on the other hand, is obtained from sqlite3_malloc() and must be freed by the application by passing it to sqlite3_free().

Here the C value is passed directly to C.GoString. I'm not an expert in CGO and I don't know if this could be a potential memory leak.

return C.GoString(C.sqlite3_expanded_sql(stmt.stmt))

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