aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-23 14:57:53 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-23 14:57:53 +0000
commitf9fc516879d2abefb2f528ddb287f7ac8cd6d98c (patch)
tree8f6e248fa3039493d2c8bc60df638cf625a1a159
parentf5efff77ce110c2e87014e183d0edafe8850ac83 (diff)
backport list handling fix from trunk (solves memory leak problem in cdr variables and device state watchers)
remove unusued variable to silence compiler warning git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@10863 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--dnsmgr.c1
-rw-r--r--include/asterisk/linkedlists.h7
2 files changed, 5 insertions, 3 deletions
diff --git a/dnsmgr.c b/dnsmgr.c
index bc577c852..f1a9dbe59 100644
--- a/dnsmgr.c
+++ b/dnsmgr.c
@@ -307,7 +307,6 @@ static int do_reload(int loading)
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 */
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index ef54ed444..8cf251b8b 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -274,9 +274,11 @@ struct { \
#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 @@ struct { \
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 \