Fixed resource leakage during connection accept(2)
[middleman.git] / include / mime.h
1 #ifndef MIME_H
2 #define MIME_H
3
4 #define MIME_LL_NEW(x) { \
5    if (x == NULL) \
6       x = xmalloc(sizeof(MIME_LIST)); \
7    else { \
8       while (x->next != NULL) x = x->next; \
9       x->next = xmalloc(sizeof(MIME_LIST)); \
10       x = x->next; \
11    } \
12    x->template = NULL; \
13    x->he = NULL; \
14    x->me = NULL; \
15    x->next = NULL; \
16 };
17
18 #define MIME_LL_INSERT(x, a, b, c) { \
19    if (a != NULL && x->template == NULL) \
20       x->template = xstrdup(a); \
21    if (b != NULL && x->he == NULL) \
22       x->he = reg_compile(b, REGFLAGS | REG_NOSUB); \
23    if (c != NULL && x->me == NULL) \
24       x->me = reg_compile(c, REGFLAGS | REG_NOSUB); \
25 };
26
27 #endif                          /* MIME_H */