diff options
author | pommicket <pommicket@gmail.com> | 2023-09-13 23:11:15 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-14 10:47:51 -0400 |
commit | 52015e0c9a4e3bc8dc558929a85461f079dda303 (patch) | |
tree | bfdf9bda87934dbd96d4da1e87454d22184545b7 /ide-autocomplete.c | |
parent | e33379bab95031555ed5459ee8a73672f24fd0a0 (diff) |
batch write requests, fix tiny memory leak in ide-autocomplete
Diffstat (limited to 'ide-autocomplete.c')
-rw-r--r-- | ide-autocomplete.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ide-autocomplete.c b/ide-autocomplete.c index 0ad78ed..6089818 100644 --- a/ide-autocomplete.c +++ b/ide-autocomplete.c @@ -399,6 +399,7 @@ void autocomplete_process_lsp_response(Ted *ted, const LSPResponse *response) { // only show phantom if there is exactly 1 possible completion. if (ncandidates == 1) { + free(ac->phantom); ac->phantom = str_dup(candidate); } else { autocomplete_clear_phantom(ac); @@ -429,6 +430,7 @@ void autocomplete_process_lsp_response(Ted *ted, const LSPResponse *response) { } if (ac->last_request_phantom) { assert(ncompletions == 1); + free(ac->phantom); ac->phantom = str_dup(ac->completions[0].text); autocomplete_clear_completions(ac); return; |