mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
Remove OOM checks: suggested changes in review
- Replace a vim_strsave/free pair with xrealloc - Use xmallocz() in some places - Use xrealloc() and forget about the NULL pointer case - Remove invalid comment - Remove unnecessary checks - Replace a complicated xmalloc/STRCPY/free code chunk code with xrealloc() - Replace a vim_strsave/free code chunk with xrealloc()
This commit is contained in:
@@ -4304,14 +4304,9 @@ replace_termcodes (
|
||||
}
|
||||
result[dlen] = NUL;
|
||||
|
||||
/*
|
||||
* Copy the new string to allocated memory.
|
||||
* If this fails, just return from.
|
||||
*/
|
||||
*bufp = vim_strsave(result);
|
||||
from = *bufp;
|
||||
free(result);
|
||||
return from;
|
||||
*bufp = xrealloc(result, dlen + 1);
|
||||
|
||||
return *bufp;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user