From d31e68d5d0d05fc51db01d85a6d02c01e9fa2559 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 19 May 2022 22:23:17 -0400 Subject: [PATCH] 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. --- src/nvim/os/users.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }