Fixed resource leakage during connection accept(2)
[middleman.git] / include / hash.h
1 #ifndef HASH_H
2 #define HASH_H
3
4 #define HASH_LIST_ADD(x, a, b) { \
5    if (x == NULL) \
6       x = xmalloc(sizeof(struct HASH_LIST)); \
7    else { \
8       while (x->next != NULL) x = x->next; \
9       x->next = xmalloc(sizeof(struct HASH_LIST)); \
10       x = x->next; \
11    } \
12    x->ref = xstrdup(a); \
13    x->data = b; \
14    x->age = time(NULL); \
15    x->next = NULL; \
16 };
17
18
19 #endif                          /* HASH_H */