Mercurial > vim
comparison src/charset.c @ 29465:1ae3e2d691a0 v9.0.0074
patch 9.0.0074: Coverity warns for double free
Commit: https://github.com/vim/vim/commit/34a1f779791fd4137547fa72addeb147b7704604
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 26 11:20:48 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Jul 2022 12:30:05 +0200 |
parents | decd0a51b99f |
children | 6387e75a4a6b |
comparison
equal
deleted
inserted
replaced
29464:3a229fb63f78 | 29465:1ae3e2d691a0 |
---|---|
962 void | 962 void |
963 clear_chartabsize_arg(chartabsize_T *cts UNUSED) | 963 clear_chartabsize_arg(chartabsize_T *cts UNUSED) |
964 { | 964 { |
965 #ifdef FEAT_PROP_POPUP | 965 #ifdef FEAT_PROP_POPUP |
966 if (cts->cts_text_prop_count > 0) | 966 if (cts->cts_text_prop_count > 0) |
967 { | |
967 vim_free(cts->cts_text_props); | 968 vim_free(cts->cts_text_props); |
969 cts->cts_text_prop_count = 0; // avoid double free | |
970 } | |
968 #endif | 971 #endif |
969 } | 972 } |
970 | 973 |
971 /* | 974 /* |
972 * Like chartabsize(), but also check for line breaks on the screen and text | 975 * Like chartabsize(), but also check for line breaks on the screen and text |