aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Vigouroux <thomas.vigouroux@protonmail.com>2022-06-24 08:29:15 +0200
committerThomas Vigouroux <thomas.vigouroux@protonmail.com>2022-06-27 06:55:41 +0200
commit89f75dcd1f779a93936c90c7a124c2983c018df0 (patch)
tree26efcd5195d8a8cd2ecfdcd86bf7d18b6d79cfe0 /test
parentfd3008a6aeba743080d0452b326e929786c57eb7 (diff)
downloadrneovim-89f75dcd1f779a93936c90c7a124c2983c018df0.tar.gz
rneovim-89f75dcd1f779a93936c90c7a124c2983c018df0.tar.bz2
rneovim-89f75dcd1f779a93936c90c7a124c2983c018df0.zip
fix(coverity/348300): free memory when overiding sing attribute
Nothing prevent the user from doing `:sign define abc culhl=Normal culhl=Normal` and thus this leads to an obvious memory leak.
Diffstat (limited to 'test')
-rw-r--r--test/functional/ex_cmds/sign_spec.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/ex_cmds/sign_spec.lua b/test/functional/ex_cmds/sign_spec.lua
index 891cfe1670..f280a45174 100644
--- a/test/functional/ex_cmds/sign_spec.lua
+++ b/test/functional/ex_cmds/sign_spec.lua
@@ -1,5 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
-local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq
+local clear, nvim, eq, assert_alive = helpers.clear, helpers.nvim, helpers.eq, helpers.assert_alive
describe('sign', function()
before_each(clear)
@@ -21,4 +21,11 @@ describe('sign', function()
end)
end)
end)
+
+ describe('define {id}', function()
+ it ('does not leak memory when specifying multiple times the same argument', function()
+ nvim('command', 'sign define Foo culhl=Normal culhl=Normal')
+ assert_alive()
+ end)
+ end)
end)