Skip to content

Commit

Permalink
sieve/bc_eval.c: fix memory leak due to implicit string copy
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Stepanek <rsto@fastmailteam.com>
  • Loading branch information
rsto committed May 10, 2023
1 parent 227a89d commit 5a412c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sieve/bc_eval.c
Expand Up @@ -2057,7 +2057,7 @@ int sieve_eval_bc(sieve_execute_t *exe, int *impl_keep_p, sieve_interp_t *i,
case B_ENOTIFY:
case B_NOTIFY:
{
const char *method = cmd.u.n.method;
char *method = cmd.u.n.method;
const char *message = cmd.u.n.message;
const char *priority = priority_to_string(cmd.u.n.priority);

Expand All @@ -2080,7 +2080,7 @@ int sieve_eval_bc(sieve_execute_t *exe, int *impl_keep_p, sieve_interp_t *i,
if (op == B_ENOTIFY) {
/* Parse/split the method URI */
if (!strncasecmp(method, "mailto:", 7)) {
strarray_insert(cmd.u.n.options, 0, method+7);
strarray_insertm(cmd.u.n.options, 0, method+7);
method = "mailto";
}
else if (!strncasecmp(method,
Expand Down

0 comments on commit 5a412c0

Please sign in to comment.