aboutsummaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-04-04 14:24:13 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-11 12:57:59 -0300
commit86279cefae74ead8c740575d294ef06e12aa7da8 (patch)
treeb0be9f06cb3aec89629c8ab8bb60a6cddce010ae /src/fileio.c
parent3fcdb2ab29f6285b4b5b4fd706db54a98b1a773f (diff)
downloadrneovim-86279cefae74ead8c740575d294ef06e12aa7da8.tar.gz
rneovim-86279cefae74ead8c740575d294ef06e12aa7da8.tar.bz2
rneovim-86279cefae74ead8c740575d294ef06e12aa7da8.zip
Remove more OOM error handling code
From the functions: - ExpandBufnames - buf_modname() - do_autocmd_event() - ff_create_stack_element() - ff_get_visited_list() - ins_complete() - msg_show_console_dialog() - prt_find_resource() - vim_findfile_init() TODO: refactor msg_show_console_dialog() to make sure it doesn't ever return NULL.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 7f2d7b1098..5bf75e34c4 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4739,8 +4739,6 @@ buf_modname (
*/
if (fname == NULL || *fname == NUL) {
retval = alloc((unsigned)(MAXPATHL + extlen + 3));
- if (retval == NULL)
- return NULL;
if (os_dirname(retval, MAXPATHL) == FAIL ||
(fnamelen = (int)STRLEN(retval)) == 0) {
vim_free(retval);
@@ -4756,8 +4754,6 @@ buf_modname (
} else {
fnamelen = (int)STRLEN(fname);
retval = alloc((unsigned)(fnamelen + extlen + 3));
- if (retval == NULL)
- return NULL;
STRCPY(retval, fname);
}
@@ -6772,8 +6768,6 @@ static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd,
}
ap = (AutoPat *)alloc((unsigned)sizeof(AutoPat));
- if (ap == NULL)
- return FAIL;
ap->pat = vim_strnsave(pat, patlen);
ap->patlen = patlen;
if (ap->pat == NULL) {
@@ -6815,8 +6809,6 @@ static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd,
while ((ac = *prev_ac) != NULL)
prev_ac = &ac->next;
ac = (AutoCmd *)alloc((unsigned)sizeof(AutoCmd));
- if (ac == NULL)
- return FAIL;
ac->cmd = vim_strsave(cmd);
ac->scriptID = current_SID;
if (ac->cmd == NULL) {