Coverage Report

Created: 2026-05-30 06:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/pigeonhole/src/lib-sieve/plugins/vacation/ext-vacation-common.c
Line
Count
Source
1
/* Copyright (c) 2002-2018 Pigeonhole authors, see the included COPYING file
2
 */
3
4
#include "lib.h"
5
#include "settings.h"
6
7
#include "sieve-common.h"
8
#include "sieve-error.h"
9
#include "sieve-extensions.h"
10
11
#include "ext-vacation-common.h"
12
13
int ext_vacation_load(const struct sieve_extension *ext, void **context)
14
0
{
15
0
  struct sieve_instance *svinst = ext->svinst;
16
0
  const struct ext_vacation_settings *set;
17
0
  struct ext_vacation_context *extctx;
18
0
  const char *error;
19
20
0
  if (*context != NULL) {
21
0
    ext_vacation_unload(ext);
22
0
    *context = NULL;
23
0
  }
24
25
0
  if (settings_get(svinst->event, &ext_vacation_setting_parser_info, 0,
26
0
       &set, &error) < 0) {
27
0
    e_error(svinst->event, "%s", error);
28
0
    return -1;
29
0
  }
30
31
0
  extctx = i_new(struct ext_vacation_context, 1);
32
0
  extctx->set = set;
33
34
0
  *context = extctx;
35
0
  return 0;
36
0
}
37
38
void ext_vacation_unload(const struct sieve_extension *ext)
39
0
{
40
0
  struct ext_vacation_context *extctx = ext->context;
41
42
0
  if (extctx == NULL)
43
0
    return;
44
0
  settings_free(extctx->set);
45
  i_free(extctx);
46
0
}