diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-11 12:42:52 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-11 20:22:36 -0300 |
commit | 8ee5659d83383d857039f8fc58d7ebc21df27905 (patch) | |
tree | 548d178953fe620fd2edda4e746a0186ad222aed /src/nvim/ex_cmds.c | |
parent | b603404487e0daa101deacbe346aa2fc9ee255c7 (diff) | |
download | rneovim-8ee5659d83383d857039f8fc58d7ebc21df27905.tar.gz rneovim-8ee5659d83383d857039f8fc58d7ebc21df27905.tar.bz2 rneovim-8ee5659d83383d857039f8fc58d7ebc21df27905.zip |
GA_DEEP_FREE_PTR: deep free macro for garrays that store simple pointers
By "simple pointer" I mean a pointer that can be freed with a call to `free`
without leaking any member pointer.
This macro does exactly what `ga_clear_strings` does.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 5ae03c6be3..701e969393 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5625,9 +5625,7 @@ helptags_one ( if (mix) got_int = FALSE; /* continue with other languages */ - for (int i = 0; i < ga.ga_len; ++i) - free(((char_u **)ga.ga_data)[i]); - ga_clear(&ga); + GA_DEEP_CLEAR_PTR(&ga); fclose(fd_tags); /* there is no check for an error... */ } |