0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0074: Coverity warns for double free

Problem:    Coverity warns for double free.
Solution:   Reset cts_text_prop_count when freeing cts_text_props.
This commit is contained in:
Bram Moolenaar
2022-07-26 11:20:48 +01:00
parent 1b67f07f76
commit 34a1f77979
3 changed files with 9 additions and 3 deletions

View File

@@ -4570,9 +4570,10 @@ typedef struct {
char_u *cts_line; // start of the line
char_u *cts_ptr; // current position in line
#ifdef FEAT_PROP_POPUP
int cts_text_prop_count; // number of text props
textprop_T *cts_text_props; // text props (allocated) or NULL
char cts_has_prop_with_text; // TRUE if if a property inserts text
int cts_text_prop_count; // number of text props; when zero
// cts_text_props is not used
textprop_T *cts_text_props; // text props (allocated)
char cts_has_prop_with_text; // TRUE if if a property inserts text
int cts_cur_text_width; // width of current inserted text
#endif
int cts_vcol; // virtual column at current position