diff options
author | James McCoy <jamessan@jamessan.com> | 2022-05-22 13:29:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-22 10:29:15 -0700 |
commit | 47d9a393de766d8e444043f5bc40dc774d45fece (patch) | |
tree | bc0f56059c77f6fdb9588fe0ec14ab419bc4ac90 /src/nvim/api/private/helpers.c | |
parent | 7f6d2984a86784c1a11a9f86ce827dbc7f648f28 (diff) | |
download | rneovim-47d9a393de766d8e444043f5bc40dc774d45fece.tar.gz rneovim-47d9a393de766d8e444043f5bc40dc774d45fece.tar.bz2 rneovim-47d9a393de766d8e444043f5bc40dc774d45fece.zip |
fix(cid/352839): USE_AFTER_FREE in create_user_command #18669
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r-- | src/nvim/api/private/helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 5d4b84482b..adabb1471e 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -1616,7 +1616,7 @@ void create_user_command(String name, Object command, Dict(user_command) *opts, if (uc_add_command(name.data, name.size, rep, argt, def, flags, compl, compl_arg, compl_luaref, addr_type_arg, luaref, force) != OK) { api_set_error(err, kErrorTypeException, "Failed to create user command"); - goto err; + // Do not goto err, since uc_add_command now owns luaref, compl_luaref, and compl_arg } return; |