diff options
author | Richard Mudgett <rmudgett@digium.com> | 2011-04-25 21:55:00 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2011-04-25 21:55:00 +0000 |
commit | e2b21c4942b9d18a2f1c5008d3fd2cf1f7896004 (patch) | |
tree | b529982a47b7659c206a26bea18599ef69f3b67e /channels | |
parent | afc8368deaab417a5e481c1f8709737cfb025560 (diff) |
Merged revisions 315349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r315349 | rmudgett | 2011-04-25 16:49:00 -0500 (Mon, 25 Apr 2011) | 9 lines
When using MGCP realtime gateway definitions, random crashes occur.
Fixed incorrect linked list node removal for realtime gateways.
(closes issue #18291)
Reported by: nahuelgreco
Patches:
dangling-pointers-when-pruning.patch uploaded by nahuelgreco (license 162)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_mgcp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 32886a6a7..e98b24f61 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3770,7 +3770,7 @@ static void *do_monitor(void *data) { int res; int reloading; - struct mgcp_gateway *g, *gprev, *gnext; + struct mgcp_gateway *g, *gprev; /*struct mgcp_gateway *g;*/ /*struct mgcp_endpoint *e;*/ /*time_t thispass = 0, lastpass = 0;*/ @@ -3840,12 +3840,10 @@ static void *do_monitor(void *data) g = gateways; gprev = NULL; while(g) { - gnext = g->next; if(g->realtime) { if(mgcp_prune_realtime_gateway(g)) { if(gprev) { - gprev->next = gnext; - gprev = g; + gprev->next = g->next; } else { gateways = g->next; } @@ -3859,7 +3857,7 @@ static void *do_monitor(void *data) } else { gprev = g; } - g = gnext; + g = g->next; } ast_mutex_unlock(&gatelock); lastrun = time(NULL); |