[asterisk-commits] qwell: branch 1.2 r74373 - /branches/1.2/dns.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 10 13:37:23 CDT 2007
Author: qwell
Date: Tue Jul 10 13:37:23 2007
New Revision: 74373
URL: http://svn.digium.com/view/asterisk?view=rev&rev=74373
Log:
Use res_ndestroy on systems that have it. Otherwise, use res_nclose.
This prevents a memleak on NetBSD - and possibly others.
Issue 10133, patch by me, reported and tested by scw
Modified:
branches/1.2/dns.c
Modified: branches/1.2/dns.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/dns.c?view=diff&rev=74373&r1=74372&r2=74373
==============================================================================
--- branches/1.2/dns.c (original)
+++ branches/1.2/dns.c Tue Jul 10 13:37:23 2007
@@ -175,6 +175,9 @@
#if defined(res_ninit)
#define HAS_RES_NINIT
+#if defined(res_ndestroy)
+#define HAS_RES_NDESTROY
+#endif
#else
AST_MUTEX_DEFINE_STATIC(res_lock);
#if 0
@@ -217,7 +220,11 @@
ret = 1;
}
#ifdef HAS_RES_NINIT
+#ifdef HAS_RES_NDESTROY
+ res_ndestroy(&dnsstate);
+#else
res_nclose(&dnsstate);
+#endif
#else
#ifndef __APPLE__
res_close();
More information about the asterisk-commits
mailing list