1 |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <unistd.h> |
|
|
#include <sys/types.h> |
|
2 |
#include <string.h> |
#include <string.h> |
3 |
|
#include <unistd.h> |
4 |
#include <errno.h> |
#include <errno.h> |
|
#include <sys/mman.h> |
|
5 |
#include <sys/time.h> |
#include <sys/time.h> |
6 |
#include <sys/resource.h> |
#include <sys/resource.h> |
7 |
|
|
|
|
|
8 |
#include "config.h" |
#include "config.h" |
9 |
#include "imapfilter.h" |
#include "imapfilter.h" |
10 |
|
|
11 |
|
|
12 |
|
/* Secure memory information. */ |
13 |
|
typedef struct secmem { |
14 |
|
void *buf; /* Allocated memory buffer. */ |
15 |
|
size_t size; /* Size of the buffer. */ |
16 |
|
struct secmem *prev, *next; /* Previous/next node of doubly linked |
17 |
|
* list. */ |
18 |
|
} secmem_t; |
19 |
|
|
20 |
|
|
21 |
extern unsigned int options; |
extern unsigned int options; |
22 |
|
|
23 |
static secmem_t *smem = NULL; /* First node of secure memory linked list. */ |
static secmem_t *smem = NULL; /* First node of secure memory linked list. */ |
24 |
|
|
25 |
|
|
26 |
|
void secmem_append(secmem_t * node); |
27 |
|
secmem_t *secmem_find(void *ptr); |
28 |
|
void secmem_remove(secmem_t * node); |
29 |
|
|
30 |
|
|
31 |
/* |
/* |
32 |
* A malloc() that checks the results and dies in case of error. |
* A malloc() that checks the results and dies in case of error. |
33 |
*/ |
*/ |