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/vim9execute.c b/src/vim9execute.c
index 33e9244..fabce4d 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1469,10 +1469,8 @@
}
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)