Mercurial > vim
comparison src/userfunc.c @ 28936:5a34620140c0 v8.2.4990
patch 8.2.4990: memory leak when :defcompile fails
Commit: https://github.com/vim/vim/commit/1a56ea8381b79c4e7697b6a05451dde5940228ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 21 16:28:42 2022 +0100
patch 8.2.4990: memory leak when :defcompile fails
Problem: Memory leak when :defcompile fails.
Solution: Free fname when returning early.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 21 May 2022 17:30:02 +0200 |
parents | a712ea475390 |
children | b02044bc8c20 |
comparison
equal
deleted
inserted
replaced
28935:4b587312c133 | 28936:5a34620140c0 |
---|---|
5035 semsg(_(e_invalid_argument_str), name); | 5035 semsg(_(e_invalid_argument_str), name); |
5036 return NULL; | 5036 return NULL; |
5037 } | 5037 } |
5038 if (!ends_excmd2(name, arg)) | 5038 if (!ends_excmd2(name, arg)) |
5039 { | 5039 { |
5040 vim_free(fname); | |
5040 emsg(ex_errmsg(e_trailing_characters_str, arg)); | 5041 emsg(ex_errmsg(e_trailing_characters_str, arg)); |
5041 return NULL; | 5042 return NULL; |
5042 } | 5043 } |
5043 | 5044 |
5044 ufunc = find_func(fname, is_global); | 5045 ufunc = find_func(fname, is_global); |