Mercurial > vim
diff src/vim9execute.c @ 24954:9b7fac4c70a0 v8.2.3014
patch 8.2.3014: Coverity warns for freeing static string
Commit: https://github.com/vim/vim/commit/6e9695525e212466398a269a54bc4d53625673f0
Author: Dominique Pelle <dominique.pelle@gmail.com>
Date: Thu Jun 17 13:53:41 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Jun 2021 14:00:06 +0200 |
parents | ffe784fdec57 |
children | d0b6a8d82cef |
line wrap: on
line diff
--- 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)