Patch 9.0.0128
Problem:    Coverity complains about possible double free.
Solution:   Clear the pointer to avoid warnings.
Files:      src/charset.c


*** ../vim-9.0.0127/src/charset.c       2022-08-01 11:17:36.757985327 +0100
--- src/charset.c       2022-08-01 12:06:06.778321007 +0100
***************
*** 912,927 ****
        char_u          *line,
        char_u          *ptr)
  {
      cts->cts_win = wp;
      cts->cts_lnum = lnum;
      cts->cts_vcol = col;
      cts->cts_line = line;
      cts->cts_ptr = ptr;
  #ifdef FEAT_PROP_POPUP
-     cts->cts_text_prop_count = 0;
-     cts->cts_has_prop_with_text = FALSE;
-     cts->cts_cur_text_width = 0;
-     cts->cts_with_trailing = 0;
      if (lnum > 0)
      {
        char_u *prop_start;
--- 912,924 ----
        char_u          *line,
        char_u          *ptr)
  {
+     CLEAR_POINTER(cts);
      cts->cts_win = wp;
      cts->cts_lnum = lnum;
      cts->cts_vcol = col;
      cts->cts_line = line;
      cts->cts_ptr = ptr;
  #ifdef FEAT_PROP_POPUP
      if (lnum > 0)
      {
        char_u *prop_start;
***************
*** 951,957 ****
                if (!cts->cts_has_prop_with_text)
                {
                    // won't use the text properties, free them
!                   vim_free(cts->cts_text_props);
                    cts->cts_text_prop_count = 0;
                }
            }
--- 948,954 ----
                if (!cts->cts_has_prop_with_text)
                {
                    // won't use the text properties, free them
!                   VIM_CLEAR(cts->cts_text_props);
                    cts->cts_text_prop_count = 0;
                }
            }
***************
*** 969,976 ****
  #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
  }
--- 966,973 ----
  #ifdef FEAT_PROP_POPUP
      if (cts->cts_text_prop_count > 0)
      {
!       VIM_CLEAR(cts->cts_text_props);
!       cts->cts_text_prop_count = 0;
      }
  #endif
  }
*** ../vim-9.0.0127/src/version.c       2022-08-01 11:49:41.218734039 +0100
--- src/version.c       2022-08-01 12:05:20.394664637 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     128,
  /**/

-- 
Don't be humble ... you're not that great.
                      -- Golda Meir

 /// 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/20220801115655.4445A1C0C11%40moolenaar.net.

Raspunde prin e-mail lui