mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
vim-patch:8.1.1897: may free memory twice when out of memory (#10827)
Problem: May free memory twice when out of memory.
Solution: Check that backslash_halve_save() returns a different pointer.
(Dominique Pelle, closes vim/vim#4847)
f1552d07d7
This commit is contained in:

committed by
Daniel Hahler

parent
bb50eadc84
commit
ed28668392
@@ -1900,7 +1900,8 @@ void backslash_halve(char_u *p)
|
||||
/// @param p
|
||||
///
|
||||
/// @return String with the number of backslashes halved.
|
||||
char_u* backslash_halve_save(char_u *p)
|
||||
char_u *backslash_halve_save(const char_u *p)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
|
||||
{
|
||||
// TODO(philix): simplify and improve backslash_halve_save algorithm
|
||||
char_u *res = vim_strsave(p);
|
||||
|
Reference in New Issue
Block a user