X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f3f9fe5c6f21a00accc994e0b79480d247f9d6db..92583637b25b6bde926f9ca6be7b085e5ac8b1e6:/src/src/functions.h diff --git a/src/src/functions.h b/src/src/functions.h index 6d16e69c2..83fad740b 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -967,13 +967,27 @@ g->s = s; /******************************************************************************/ +/* Use store_malloc for DNSA structs, and explicit frees. Using the same pool +for them as the strings we proceed to copy from them meant they could not be +released, hence blowing 64k for every DNS lookup. That mounted up. With malloc +we do have to take care over marking tainted all copied strings. A separate pool +could be used and would handle that implicitly. */ #define store_get_dns_answer() store_get_dns_answer_trc(CUS __FUNCTION__, __LINE__) static inline dns_answer * store_get_dns_answer_trc(const uschar * func, unsigned line) { -return store_get_3(sizeof(dns_answer), TRUE, CCS func, line); /* use tainted mem */ +/* return store_get_3(sizeof(dns_answer), TRUE, CCS func, line); use tainted mem */ +return store_malloc_3(sizeof(dns_answer), CCS func, line); +} + +#define store_free_dns_answer(dnsa) store_free_dns_answer_trc(dnsa, CUS __FUNCTION__, __LINE__) + +static inline void +store_free_dns_answer_trc(dns_answer * dnsa, const uschar * func, unsigned line) +{ +store_free_3(dnsa, CCS func, line); } /******************************************************************************/