From: Dominique Pelle Date: Thu, 17 Jun 2021 11:53:41 +0000 (+0200) Subject: patch 8.2.3014: Coverity warns for freeing static string X-Git-Tag: v8.2.3014 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e9695525e212466398a269a54bc4d53625673f0;p=vim patch 8.2.3014: Coverity warns for freeing static string Problem: Coverity warns for freeing static string. Solution: Do not assign static string to pointer. (Dominique Pellé, closes #8397) --- diff --git a/src/version.c b/src/version.c index 2dff11cd7..99c086f5b 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3014, /**/ 3013, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 33e924424..fabce4dbe 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1469,10 +1469,8 @@ handle_debug(isn_T *iptr, ectx_T *ectx) } else line = ((char_u **)ufunc->uf_lines.ga_data)[iptr->isn_lnum - 1]; - if (line == NULL) - line = (char_u *)"[empty]"; - do_debug(line); + do_debug(line == NULL ? (char_u *)"[empty]" : line); debug_context = NULL; if (end_lnum > iptr->isn_lnum)