summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 9ffafc371..ffbbc2d21 100644
--- 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)