]> granicus.if.org Git - vim/commitdiff
patch 8.2.3014: Coverity warns for freeing static string v8.2.3014
authorDominique Pelle <dominique.pelle@gmail.com>
Thu, 17 Jun 2021 11:53:41 +0000 (13:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 17 Jun 2021 11:53:41 +0000 (13:53 +0200)
Problem:    Coverity warns for freeing static string.
Solution:   Do not assign static string to pointer. (Dominique PellĂ©,
            closes #8397)

src/version.c
src/vim9execute.c

index 2dff11cd7aca05167d16c40d834ef04c4472f155..99c086f5b587b5ab72b4463adecd630226e6f0a6 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3014,
 /**/
     3013,
 /**/
index 33e92442451db53e42c2de0e0c05c7146a9a94cd..fabce4dbe7c86bb2d29619f6daa731d8580a244e 100644 (file)
@@ -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)