diff src/userfunc.c @ 9612:0e7912e7064b v7.4.2083

commit https://github.com/vim/vim/commit/19df5cc04de93519145901d9cbc78c44d0c47c5d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 20 22:11:06 2016 +0200 patch 7.4.2083 Problem: Coverity complains about not restoring a value. Solution: Restore the value, although it's not really needed. Change return to jump to cleanup, might leak memory.
author Christian Brabandt <cb@256bit.org>
date Wed, 20 Jul 2016 22:15:06 +0200
parents 3ca0fd9709b1
children 172131507c85
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -199,14 +199,17 @@ get_function_args(
 		break;
 	    }
 	    if (newargs != NULL && ga_grow(newargs, 1) == FAIL)
-		return FAIL;
+		goto err_ret;
 	    if (newargs != NULL)
 	    {
 		c = *p;
 		*p = NUL;
 		arg = vim_strsave(arg);
 		if (arg == NULL)
+		{
+		    *p = c;
 		    goto err_ret;
+		}
 
 		/* Check for duplicate argument name. */
 		for (i = 0; i < newargs->ga_len; ++i)