Patch 9.0.0074
Problem:    Coverity warns for double free.
Solution:   Reset cts_text_prop_count when freeing cts_text_props.
Files:      src/charset.c, src/structs.h


*** ../vim-9.0.0073/src/charset.c       2022-07-25 18:35:11.998814206 +0100
--- src/charset.c       2022-07-26 11:17:24.977380367 +0100
***************
*** 964,970 ****
--- 964,973 ----
  {
  #ifdef FEAT_PROP_POPUP
      if (cts->cts_text_prop_count > 0)
+     {
        vim_free(cts->cts_text_props);
+       cts->cts_text_prop_count = 0;  // avoid double free
+     }
  #endif
  }
  
*** ../vim-9.0.0073/src/structs.h       2022-07-25 18:13:33.054580717 +0100
--- src/structs.h       2022-07-26 11:18:30.597001769 +0100
***************
*** 4570,4578 ****
      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_cur_text_width;     // width of current inserted text
  #endif
      int               cts_vcol;           // virtual column at current 
position
--- 4570,4579 ----
      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; 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
*** ../vim-9.0.0073/src/version.c       2022-07-25 21:40:03.173430713 +0100
--- src/version.c       2022-07-26 11:16:31.405705463 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     74,
  /**/

-- 
You cannot have a baby in one month by getting nine women pregnant.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220726102121.D66641C0656%40moolenaar.net.

Raspunde prin e-mail lui