[asterisk-commits] branch 1.2 r10863 - in /branches/1.2: dnsmgr.c include/asterisk/linkedlists.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 23 07:58:13 MST 2006


Author: kpfleming
Date: Thu Feb 23 08:57:53 2006
New Revision: 10863

URL: http://svn.digium.com/view/asterisk?rev=10863&view=rev
Log:
backport list handling fix from trunk (solves memory leak problem in cdr variables and device state watchers)
remove unusued variable to silence compiler warning

Modified:
    branches/1.2/dnsmgr.c
    branches/1.2/include/asterisk/linkedlists.h

Modified: branches/1.2/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/dnsmgr.c?rev=10863&r1=10862&r2=10863&view=diff
==============================================================================
--- branches/1.2/dnsmgr.c (original)
+++ branches/1.2/dnsmgr.c Thu Feb 23 08:57:53 2006
@@ -307,7 +307,6 @@
 	const char *enabled_value;
 	int interval;
 	int was_enabled;
-	pthread_attr_t attr;
 	int res = -1;
 
 	/* ensure that no refresh cycles run while the reload is in progress */

Modified: branches/1.2/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/include/asterisk/linkedlists.h?rev=10863&r1=10862&r2=10863&view=diff
==============================================================================
--- branches/1.2/include/asterisk/linkedlists.h (original)
+++ branches/1.2/include/asterisk/linkedlists.h Thu Feb 23 08:57:53 2006
@@ -274,9 +274,11 @@
 #define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) {				\
 	typeof((head)->first) __list_next;						\
 	typeof((head)->first) __list_prev = NULL;					\
-	for ((var) = (head)->first,  __list_next = (var) ? (var)->field.next : NULL;	\
+	typeof((head)->first) __new_prev = NULL;					\
+	for ((var) = (head)->first, __new_prev = (var),					\
+	      __list_next = (var) ? (var)->field.next : NULL;				\
 	     (var);									\
-	     __list_prev = (var), (var) = __list_next,					\
+	     __list_prev = __new_prev, (var) = __list_next,				\
 	     __list_next = (var) ? (var)->field.next : NULL				\
 	    )
 
@@ -292,6 +294,7 @@
   previous entry, if any).
  */
 #define AST_LIST_REMOVE_CURRENT(head, field)						\
+	__new_prev = __list_prev;							\
 	if (__list_prev)								\
 		__list_prev->field.next = __list_next;					\
 	else										\



More information about the asterisk-commits mailing list