Merged revisions 88078 via svnmerge from
authorJason Parker <jparker@digium.com>
Thu, 1 Nov 2007 16:22:09 +0000 (16:22 +0000)
committerJason Parker <jparker@digium.com>
Thu, 1 Nov 2007 16:22:09 +0000 (16:22 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r88078 | qwell | 2007-11-01 11:21:22 -0500 (Thu, 01 Nov 2007) | 4 lines

Make sure we set the poll fds to NULL after free()ing it.

Part of issue 11017, patch by tzafrir.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88079 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index bdc786f..556cdc5 100644 (file)
@@ -7163,8 +7163,10 @@ static void *do_monitor(void *data)
                /* Lock the interface list */
                ast_mutex_lock(&iflock);
                if (!pfds || (lastalloc != ifcount)) {
-                       if (pfds)
+                       if (pfds) {
                                ast_free(pfds);
+                               pfds = NULL;
+                       }
                        if (ifcount) {
                                if (!(pfds = ast_calloc(1, ifcount * sizeof(*pfds)))) {
                                        ast_mutex_unlock(&iflock);