Skip to content

Question about the use of realloc vs. memory pools #126

@alejandro-perez

Description

@alejandro-perez

Hello,

since I'm trying to get good knowledge of the GSS attribute exportation code, I've come across the use of realloc, which is surprising to me given that memory is usually allocated by means of apr_* functions and pools. Is not realloc using plain "malloc" underneath? If so, shouldn't the code use the pool?

I've seen two uses of realloc corresponding to the GSS attribute handling.

  1. https://github.com/modauthgssapi/mod_auth_gssapi/blob/master/src/mod_auth_gssapi.c#L1631-L1644
    Here it seems that at least a cleanup fnc is registered, so memory should be freed.

  2. https://github.com/modauthgssapi/mod_auth_gssapi/blob/master/src/environ.c#L43-L51
    In this case, I don't see any cleanup function. How is this memory freed?

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