aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2022-05-19 22:23:17 -0400
committerJames McCoy <jamessan@jamessan.com>2022-05-20 08:15:13 -0400
commitd31e68d5d0d05fc51db01d85a6d02c01e9fa2559 (patch)
tree6b53da284ba97e9399f5312649c0a20efa5312fe
parentf15122e8a2938b0a440aa3d834f6648537f1951f (diff)
downloadrneovim-d31e68d5d0d05fc51db01d85a6d02c01e9fa2559.tar.gz
rneovim-d31e68d5d0d05fc51db01d85a6d02c01e9fa2559.tar.bz2
rneovim-d31e68d5d0d05fc51db01d85a6d02c01e9fa2559.zip
fix(cid/348314): free user_copy, not user
user is passed in by the caller, which we internally copy. We should be freeing our copy, not the caller's string.
-rw-r--r--src/nvim/os/users.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index 4803be20c3..3d67ae4ce0 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -30,7 +30,7 @@ static void add_user(garray_T *users, char *user, bool need_copy)
if (user_copy == NULL || *user_copy == NUL) {
if (need_copy) {
- xfree(user);
+ xfree(user_copy);
}
return;
}