X-Git-Url: http://www.privoxy.org/gitweb/templates.html?a=blobdiff_plain;f=cgiedit.c;h=2ae42e1f6c33373714b9c9612d3e0a7ea8afc65d;hb=a9e76d892e6427effc7fd2a55fddbf1c58c14106;hp=594aecf8a0711b8bf8d6f7d3523c876527b7c6d5;hpb=2b1b9b5dec7d10d8d58706a6b737eacabcc862b1;p=privoxy.git diff --git a/cgiedit.c b/cgiedit.c index 594aecf8..2ae42e1f 100644 --- a/cgiedit.c +++ b/cgiedit.c @@ -1899,12 +1899,12 @@ static jb_err get_url_spec_param(struct client_state *csp, } err = create_pattern_spec(compiled, s); free(s); + free_pattern_spec(compiled); if (err) { free(param); return (err == JB_ERR_MEMORY) ? JB_ERR_MEMORY : JB_ERR_CGI_PARAMS; } - free_pattern_spec(compiled); if (param[strlen(param) - 1] == '\\') { @@ -1935,12 +1935,12 @@ static jb_err get_url_spec_param(struct client_state *csp, } err = create_pattern_spec(compiled, s); free(s); + free_pattern_spec(compiled); if (err) { free(param); return (err == JB_ERR_MEMORY) ? JB_ERR_MEMORY : JB_ERR_CGI_PARAMS; } - free_pattern_spec(compiled); } *pvalue = param; @@ -2891,7 +2891,7 @@ jb_err cgi_edit_actions_for_url(struct client_state *csp, if ((csp->rlist[i] != NULL) && (csp->rlist[i]->f != NULL)) { filter_group = csp->rlist[i]->f; - for (;(!err) && (filter_group != NULL); filter_group = filter_group->next) + for (; (!err) && (filter_group != NULL); filter_group = filter_group->next) { char current_mode = 'x'; char number[20]; @@ -2901,6 +2901,7 @@ jb_err cgi_edit_actions_for_url(struct client_state *csp, const int multi_action_index = action_type_info[type].multi_action_index; assert(type < MAX_FILTER_TYPES); + assert(multi_action_index < ACTION_MULTI_COUNT); filter_name = cur_line->data.action->multi_add[multi_action_index]->first; while ((filter_name != NULL) @@ -4487,8 +4488,9 @@ static jb_err actions_to_radio(struct map * exports, * * Function : action_render_string_actions_template * - * Description : Converts a actionsfile entry into HTML template for actions with string - * filters (currently SUPPRESS-TAG actions only) + * Description : Converts an actionsfile entry into HTML template for + * actions with string filters (currently SUPPRESS-TAG + * actions only) * * Parameters : * 1 : exports = List of substitutions to add to. @@ -4500,16 +4502,16 @@ static jb_err actions_to_radio(struct map * exports, * JB_ERR_MEMORY on out-of-memory * *********************************************************************/ -static jb_err action_render_string_actions_template(struct map * exports, +static jb_err action_render_string_actions_template(struct map *exports, const struct action_spec *action, - const char* action_template, + const char *action_template, const struct string_action_type_info *string_action_type) { jb_err err = JB_ERR_OK; int filter_identifier = 0; int i; char *prepared_template = strdup(""); - const struct action_type_info* type = &action_type_info[string_action_type->action_type]; + const struct action_type_info *type = &action_type_info[string_action_type->action_type]; struct action_multi { char radio;