To: vim_dev@googlegroups.com Subject: Patch 9.0.0128 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///