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:
@@ -964,7 +964,10 @@ clear_chartabsize_arg(chartabsize_T *cts UNUSED)
|
|||||||
{
|
{
|
||||||
#ifdef FEAT_PROP_POPUP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (cts->cts_text_prop_count > 0)
|
if (cts->cts_text_prop_count > 0)
|
||||||
|
{
|
||||||
vim_free(cts->cts_text_props);
|
vim_free(cts->cts_text_props);
|
||||||
|
cts->cts_text_prop_count = 0; // avoid double free
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4570,9 +4570,10 @@ typedef struct {
|
|||||||
char_u *cts_line; // start of the line
|
char_u *cts_line; // start of the line
|
||||||
char_u *cts_ptr; // current position in line
|
char_u *cts_ptr; // current position in line
|
||||||
#ifdef FEAT_PROP_POPUP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int cts_text_prop_count; // number of text props
|
int cts_text_prop_count; // number of text props; when zero
|
||||||
textprop_T *cts_text_props; // text props (allocated) or NULL
|
// cts_text_props is not used
|
||||||
char cts_has_prop_with_text; // TRUE if if a property inserts text
|
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
|
int cts_cur_text_width; // width of current inserted text
|
||||||
#endif
|
#endif
|
||||||
int cts_vcol; // virtual column at current position
|
int cts_vcol; // virtual column at current position
|
||||||
|
@@ -735,6 +735,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
74,
|
||||||
/**/
|
/**/
|
||||||
73,
|
73,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user