Skip to content

Commit

Permalink
patch 8.2.2751: Coverity warns for using NULL pointer
Browse files Browse the repository at this point in the history
Problem:    Coverity warns for using NULL pointer.
Solution:   Check for NULL in calling function.
  • Loading branch information
brammool committed Apr 10, 2021
1 parent da479c7 commit fed9e83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/userfunc.c
Expand Up @@ -973,8 +973,7 @@ lambda_function_body(
garray_T *default_args,
char_u *ret_type)
{
int evaluate = evalarg != NULL
&& (evalarg->eval_flags & EVAL_EVALUATE);
int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
ufunc_T *ufunc = NULL;
exarg_T eap;
garray_T newlines;
Expand Down Expand Up @@ -1180,6 +1179,9 @@ get_lambda_tv(
// Recognize "{" as the start of a function body.
if (equal_arrow && **arg == '{')
{
if (evalarg == NULL)
// cannot happen?
goto theend;
if (lambda_function_body(arg, rettv, evalarg, pnewargs,
types_optional ? &argtypes : NULL, varargs,
&default_args, ret_type) == FAIL)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2751,
/**/
2750,
/**/
Expand Down

0 comments on commit fed9e83

Please sign in to comment.