aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_eval.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-08 21:34:46 -0300
committerFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-19 14:50:23 -0300
commita80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (patch)
treecc9cc71ee35fe966779cf6764bd5faabd1186df3 /src/nvim/ex_eval.c
parentb63d2626ed9e3e38a485b9990a8e65ba59d6906a (diff)
downloadrneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.gz
rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.bz2
rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.zip
Remove NULL/non-NULL tests after calls to vim_str(n)save()
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r--src/nvim/ex_eval.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index cc2d4b6405..277f7d8cfb 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -250,11 +250,7 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore)
EMSG(_(e_outofmem));
} else {
elem->msg = vim_strsave(mesg);
- if (elem->msg == NULL) {
- free(elem);
- suppress_errthrow = TRUE;
- EMSG(_(e_outofmem));
- } else {
+ {
elem->next = NULL;
elem->throw_msg = NULL;
*plist = elem;
@@ -402,15 +398,11 @@ char_u *get_exception_string(void *value, int type, char_u *cmdname, int *should
cmdlen = (int)STRLEN(cmdname);
ret = vim_strnsave((char_u *)"Vim(",
4 + cmdlen + 2 + (int)STRLEN(mesg));
- if (ret == NULL)
- return ret;
STRCPY(&ret[4], cmdname);
STRCPY(&ret[4 + cmdlen], "):");
val = ret + 4 + cmdlen + 2;
} else {
ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
- if (ret == NULL)
- return ret;
val = ret + 4;
}
@@ -493,11 +485,6 @@ static int throw_exception(void *value, int type, char_u *cmdname)
excp->type = type;
excp->throw_name = vim_strsave(sourcing_name == NULL
? (char_u *)"" : sourcing_name);
- if (excp->throw_name == NULL) {
- if (should_free)
- free(excp->value);
- goto nomem;
- }
excp->throw_lnum = sourcing_lnum;
if (p_verbose >= 13 || debug_break_level > 0) {