Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] HEADS-UP: libpspf2 causes milter-greylist memory leak

2008-10-25 by Johann E. Klasek

On Fri, Oct 24, 2008 at 01:34:42PM +0900, Hajimu UMEMOTO wrote:
> Hi,
> 
> >>>>> On Fri, 24 Oct 2008 05:27:18 +0200
> >>>>> manu@... said:
> 
> manu> People using --enable-dnsrbl may also have a problem on some systems.
> manu> dnsrbl.c contains:
> 
> manu> #if (defined(res_ninit) || (__RES >= 19991006) )
> manu> #define HAVE_RESN       1
> manu> #ifndef res_ndestroy
> manu> #define res_ndestroy(res)       res_nclose(res)
> manu> #endif
> manu> #else 
> manu> #define res_ninit(res) \
> manu>         ((_res.options & RES_INIT) == 0 && res_init())
> manu> #define res_nquery(res, req, class, type, ans, anslen)  \ 
> manu>         res_query(req, class, type, ans, anslen)
> manu> #define res_ndestroy(res) 
> manu> #endif
> 
> I contributed the chunk to milter-greylist.
> Where there is res_ndestroy(), we do use it.

That is only true on systems (at least Linux and NetBSD AFAIK) where
res_* consists of a macro layer which can easily checked with
preprocessor #ifdef but *not* on such systems where res_ndestroy is a
real library function! (e.g. Solaris).

For the 4.0 branch I contributed the __RES hack above (which addresses
the previous mentioned problem in a simple way), but this seems not to
help much if we want to know if res_ndestroy exists (Solaris 9 has
res_ndestroy, Solaris 8 not but both have the same __RES value ...).

> Where there is no res_ndestroy(), we use res_nclose().
> Where there is no res_n* API, we use old res_init API, and we don't
> need to issue res_nclose() nor res_ndestroy().
> I believe it covers all variations of the BIND resolver.
> If I'm thinking in a wrong way, please let me know.

What we need is an additional autoconf rule which checks the
res_ndestroy existence on a platform ...
BTW, the existence of res_ninit could be also checked (so we can
drop the somekind unreliable __RES hack).

To Manu: Yes, I know, you are expecting something that looks like
a patch ... I will try ASAP.

Johann Klasek

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.