aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-01 16:21:22 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-01 16:21:22 +0000
commit6fa32a6397c022b71be83f08e4b12f526d75cfb2 (patch)
tree52c6158437ce5ae86fd4f9e647a706b2f6cce6e4 /channels/chan_zap.c
parentdb3962456cf3d23abc3ff97529ba8d569d63fc6d (diff)
Make sure we set the poll fds to NULL after free()ing it.
Part of issue 11017, patch by tzafrir. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@88078 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index dc6bad66a..d694fd0a3 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -6784,8 +6784,10 @@ static void *do_monitor(void *data)
/* Lock the interface list */
ast_mutex_lock(&iflock);
if (!pfds || (lastalloc != ifcount)) {
- if (pfds)
+ if (pfds) {
free(pfds);
+ pfds = NULL;
+ }
if (ifcount) {
if (!(pfds = ast_calloc(1, ifcount * sizeof(*pfds)))) {
ast_mutex_unlock(&iflock);