Mercurial > vim
comparison src/evalvars.c @ 27110:62b88e6cd791 v8.2.4084
patch 8.2.4084: memory leak when looking for autoload prefixed variable
Commit: https://github.com/vim/vim/commit/130f65d46bca94535d30cef518a6184613fb7ebf
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 13 20:39:41 2022 +0000
patch 8.2.4084: memory leak when looking for autoload prefixed variable
Problem: Memory leak when looking for autoload prefixed variable.
Solution: Free the concatenated string.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 13 Jan 2022 21:45:03 +0100 |
parents | 92e2e96ff559 |
children | 98a01021e465 |
comparison
equal
deleted
inserted
replaced
27109:59e5456e816d | 27110:62b88e6cd791 |
---|---|
2887 | 2887 |
2888 if (auto_name != NULL) | 2888 if (auto_name != NULL) |
2889 { | 2889 { |
2890 ht = &globvarht; | 2890 ht = &globvarht; |
2891 ret = find_var_in_ht(ht, *name, auto_name, TRUE); | 2891 ret = find_var_in_ht(ht, *name, auto_name, TRUE); |
2892 vim_free(auto_name); | |
2892 if (ret != NULL) | 2893 if (ret != NULL) |
2893 { | 2894 { |
2894 if (htp != NULL) | 2895 if (htp != NULL) |
2895 *htp = ht; | 2896 *htp = ht; |
2896 return ret; | 2897 return ret; |
2897 } | 2898 } |
2898 } | 2899 } |
2899 vim_free(auto_name); | |
2900 } | 2900 } |
2901 } | 2901 } |
2902 | 2902 |
2903 return NULL; | 2903 return NULL; |
2904 } | 2904 } |