Skip to content

Commit

Permalink
doveadm sieve plugin: Fix memory leak for "sieve get" command
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Jun 12, 2018
1 parent eceb19e commit 5d2c313
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/doveadm-sieve/doveadm-sieve-cmd-get.c
Expand Up @@ -25,6 +25,7 @@ cmd_sieve_get_run(struct doveadm_sieve_cmd_context *_ctx)
struct sieve_script *script;
struct istream *input;
enum sieve_error error;
int ret;

script = sieve_storage_open_script
(_ctx->storage, ctx->scriptname, &error);
Expand All @@ -38,7 +39,9 @@ cmd_sieve_get_run(struct doveadm_sieve_cmd_context *_ctx)
return -1;
}

return doveadm_print_istream(input);
ret = doveadm_print_istream(input);
sieve_script_unref(&script);
return ret;
}

static void cmd_sieve_get_init
Expand Down

0 comments on commit 5d2c313

Please sign in to comment.