Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/environ.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ static bool mag_get_name_attr(request_rec *req,
return true;
}

static apr_status_t mag_mc_name_attrs_cleanup(void *data)
{
struct mag_conn *mc = (struct mag_conn *)data;
free(mc->name_attributes);
mc->name_attributes = NULL;
return 0;
}

static void mc_add_name_attribute(struct mag_conn *mc,
const char *name, const char *value)
{
Expand All @@ -44,6 +52,8 @@ static void mc_add_name_attribute(struct mag_conn *mc,
size = sizeof(struct mag_attr) * (mc->na_count + 16);
mc->name_attributes = realloc(mc->name_attributes, size);
if (!mc->name_attributes) apr_pool_abort_get(mc->pool)(ENOMEM);
apr_pool_userdata_setn(mc, GSS_NAME_ATTR_USERDATA,
mag_mc_name_attrs_cleanup, mc->pool);
}

mc->name_attributes[mc->na_count].name = apr_pstrdup(mc->pool, name);
Expand Down
2 changes: 0 additions & 2 deletions src/mod_auth_gssapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,6 @@ static const char *mag_negotiate_once(cmd_parms *parms, void *mconfig, int on)
return NULL;
}

#define GSS_NAME_ATTR_USERDATA "GSS Name Attributes Userdata"

static apr_status_t mag_name_attrs_cleanup(void *data)
{
struct mag_config *cfg = (struct mag_config *)data;
Expand Down
1 change: 1 addition & 0 deletions src/mod_auth_gssapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#endif

extern module AP_MODULE_DECLARE_DATA auth_gssapi_module;
#define GSS_NAME_ATTR_USERDATA "GSS Name Attributes Userdata"

struct mag_na_map {
char *env_name;
Expand Down