diff options
author | pommicket <pommicket@gmail.com> | 2023-09-13 23:02:40 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-13 23:02:40 -0400 |
commit | e33379bab95031555ed5459ee8a73672f24fd0a0 (patch) | |
tree | f3c99c467eaf841685d6cdc478e1bdcfedb22c4c /buffer.c | |
parent | dfe82ad946c0d87ba533f8f0b57c1e969125c97a (diff) |
fix use-after-free which broke LSP sync
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2078,7 +2078,6 @@ BufferPos buffer_insert_text_at_pos(TextBuffer *buffer, BufferPos pos, String32 buffer_lines_modified(buffer, pos.line, line_idx); BufferPos b = {.line = line_idx, .index = index}; - free(str_alloc); // we need to do this *after* making the change to the buffer // because of how non-incremental syncing works. @@ -2103,6 +2102,7 @@ BufferPos buffer_insert_text_at_pos(TextBuffer *buffer, BufferPos pos, String32 n->fn(n->context, buffer, &info); } + free(str_alloc); return b; } |