]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure we set the poll fds to NULL after free()ing it.
authorJason Parker <jparker@digium.com>
Thu, 1 Nov 2007 16:21:22 +0000 (16:21 +0000)
committerJason Parker <jparker@digium.com>
Thu, 1 Nov 2007 16:21:22 +0000 (16:21 +0000)
Part of issue 11017, patch by tzafrir.

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

channels/chan_zap.c

index dc6bad66ac35e589a0ce9a1bcdf4f83662910339..d694fd0a33cd8b47f705b2c8ff5fea5957848f8b 100644 (file)
@@ -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);