Mercurial > vim
comparison src/channel.c @ 12407:e9dbdc4d8279 v8.0.1083
patch 8.0.1083: leaking memory in input part of channel
commit https://github.com/vim/vim/commit/5b5adf5b9cd226d775643872e65c62674d6ada95
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 9 18:16:43 2017 +0200
patch 8.0.1083: leaking memory in input part of channel
Problem: Leaking memory in input part of channel.
Solution: Clear the input part of channel. Free the entry. Move failing
command test to a separate file to avoid bogus leak reports
clouding tests that should not leak.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 09 Sep 2017 18:30:05 +0200 |
parents | b44bd42a374e |
children | 579faede5d9c |
comparison
equal
deleted
inserted
replaced
12406:3448b3b3a56c | 12407:e9dbdc4d8279 |
---|---|
2937 wq->wq_next = entry->wq_next; | 2937 wq->wq_next = entry->wq_next; |
2938 if (wq->wq_next == NULL) | 2938 if (wq->wq_next == NULL) |
2939 wq->wq_prev = NULL; | 2939 wq->wq_prev = NULL; |
2940 else | 2940 else |
2941 wq->wq_next->wq_prev = NULL; | 2941 wq->wq_next->wq_prev = NULL; |
2942 vim_free(entry); | |
2942 } | 2943 } |
2943 | 2944 |
2944 /* | 2945 /* |
2945 * Clear the read buffer on "channel"/"part". | 2946 * Clear the read buffer on "channel"/"part". |
2946 */ | 2947 */ |
2988 vim_free(channel->ch_hostname); | 2989 vim_free(channel->ch_hostname); |
2989 channel->ch_hostname = NULL; | 2990 channel->ch_hostname = NULL; |
2990 channel_clear_one(channel, PART_SOCK); | 2991 channel_clear_one(channel, PART_SOCK); |
2991 channel_clear_one(channel, PART_OUT); | 2992 channel_clear_one(channel, PART_OUT); |
2992 channel_clear_one(channel, PART_ERR); | 2993 channel_clear_one(channel, PART_ERR); |
2993 /* there is no callback or queue for PART_IN */ | 2994 channel_clear_one(channel, PART_IN); |
2994 free_callback(channel->ch_callback, channel->ch_partial); | 2995 free_callback(channel->ch_callback, channel->ch_partial); |
2995 channel->ch_callback = NULL; | 2996 channel->ch_callback = NULL; |
2996 channel->ch_partial = NULL; | 2997 channel->ch_partial = NULL; |
2997 free_callback(channel->ch_close_cb, channel->ch_close_partial); | 2998 free_callback(channel->ch_close_cb, channel->ch_close_partial); |
2998 channel->ch_close_cb = NULL; | 2999 channel->ch_close_cb = NULL; |