Skip to content

Commit

Permalink
lib-storage: mail_search_args_simplify() - Fix merging already-initia…
Browse files Browse the repository at this point in the history
…lized keywords

It was deinitializing the arg that was kept instead of the one being removed.
  • Loading branch information
sirainen authored and villesavolainen committed Jun 14, 2017
1 parent c218bc4 commit ea05270
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib-storage/mail-search-args-simplify.c
Expand Up @@ -97,11 +97,14 @@ mail_search_args_merge_mask(struct mail_search_simplify_ctx *ctx,
*prev_argp = args;
return FALSE;
}

if (ctx->initialized)
mail_search_arg_one_deinit(*prev_argp);
mail_search_arg_one_deinit(args);

if ((*prev_argp)->match_not != args->match_not) {
/* a && !a = 0 */
if (ctx->initialized)
mail_search_arg_one_deinit(*prev_argp);
(*prev_argp)->type = SEARCH_ALL;
(*prev_argp)->match_not = ctx->parent_and;
}
Expand Down

0 comments on commit ea05270

Please sign in to comment.