[core] Fix segfault when regex condition errors

personal/stbuehler/wip
Thomas Porzelt 13 years ago
parent 5527654703
commit f51e9e6129
  1. 12
      src/main/actions.c

@ -133,11 +133,13 @@ static void action_stack_element_release(liServer *srv, liVRequest *vr, action_s
if (a->data.condition.cond->rvalue.type == LI_COND_VALUE_REGEXP) {
/* pop regex stack */
GArray *rs = vr->action_stack.regex_stack;
liActionRegexStackElement *arse = &g_array_index(rs, liActionRegexStackElement, rs->len - 1);
if (arse->string)
g_string_free(arse->string, TRUE);
g_match_info_free(arse->match_info);
g_array_set_size(rs, rs->len - 1);
if (rs->len) {
liActionRegexStackElement *arse = &g_array_index(rs, liActionRegexStackElement, rs->len - 1);
if (arse->string)
g_string_free(arse->string, TRUE);
g_match_info_free(arse->match_info);
g_array_set_size(rs, rs->len - 1);
}
}
break;
case ACTION_TLIST:

Loading…
Cancel
Save