Skip to content

Commit

Permalink
Don't free thing until we're done
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 6, 2014
1 parent b031495 commit 71b1957
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/modcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ static bool modcall_recurse(REQUEST *request, rlm_components_t component, int de
modcallable *this, *found, *null_case;
modgroup *g, *h;
fr_cond_t cond;
value_data_t data;
value_pair_map_t map;
value_pair_tmpl_t vpt;

Expand Down Expand Up @@ -849,11 +850,10 @@ static bool modcall_recurse(REQUEST *request, rlm_components_t component, int de
if ((g->vpt->type == TMPL_TYPE_XLAT_STRUCT) ||
(g->vpt->type == TMPL_TYPE_XLAT) ||
(g->vpt->type == TMPL_TYPE_EXEC)) {
value_data_t data;

if (radius_expand_tmpl(&data, request, g->vpt) < 0) goto find_null_case;
tmpl_init(&vpt, TMPL_TYPE_LITERAL, data.strvalue, talloc_array_length(data.strvalue) - 1);
talloc_free(data.ptr);
} else {
data.ptr = NULL;
}

/*
Expand Down Expand Up @@ -922,6 +922,7 @@ static bool modcall_recurse(REQUEST *request, rlm_components_t component, int de
if (!found) found = null_case;

do_null_case:
talloc_free(data.ptr);
modcall_child(request, component, depth + 1, entry, found, &result);
MOD_LOG_CLOSE_BRACE;
goto calculate_result;
Expand Down

0 comments on commit 71b1957

Please sign in to comment.