comparison src/channel.c @ 19758:473d7084a4a1 v8.2.0435

patch 8.2.0435: channel contents might be freed twice Commit: https://github.com/vim/vim/commit/dbbb0ef729e392e313ccc63c247bff1b828a214d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 23 22:01:17 2020 +0100 patch 8.2.0435: channel contents might be freed twice Problem: Channel contents might be freed twice. Solution: Call either channel_free_channel() or channel_free(), not both. (Nobuhiro Takasaki, closes #5835)
author Bram Moolenaar <Bram@vim.org>
date Mon, 23 Mar 2020 22:15:04 +0100
parents 5ed8297121fa
children 472dc753e985
comparison
equal deleted inserted replaced
19757:a711416a0ff0 19758:473d7084a4a1
4455 if (channel->ch_to_be_freed || channel->ch_killing) 4455 if (channel->ch_to_be_freed || channel->ch_killing)
4456 { 4456 {
4457 if (channel->ch_killing) 4457 if (channel->ch_killing)
4458 { 4458 {
4459 channel_free_contents(channel); 4459 channel_free_contents(channel);
4460 channel_free_channel(channel);
4460 channel->ch_job->jv_channel = NULL; 4461 channel->ch_job->jv_channel = NULL;
4461 } 4462 }
4462 channel_free(channel); 4463 else
4464 channel_free(channel);
4463 // channel has been freed, start over 4465 // channel has been freed, start over
4464 channel = first_channel; 4466 channel = first_channel;
4465 continue; 4467 continue;
4466 } 4468 }
4467 if (channel->ch_refcount == 0 && !channel_still_useful(channel)) 4469 if (channel->ch_refcount == 0 && !channel_still_useful(channel))