aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-10 00:46:30 -0300
committerFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-19 14:50:24 -0300
commit1ca3368ce3ec6da2acda91ac8b1d00399d10b045 (patch)
treeb148b8240724abc347a28614130a4c7bfefc383e /src
parent679629649b51749ea0fc834c97c1e47239bc1884 (diff)
downloadrneovim-1ca3368ce3ec6da2acda91ac8b1d00399d10b045.tar.gz
rneovim-1ca3368ce3ec6da2acda91ac8b1d00399d10b045.tar.bz2
rneovim-1ca3368ce3ec6da2acda91ac8b1d00399d10b045.zip
Remove OOM checks: ml_new_data()
Diffstat (limited to 'src')
-rw-r--r--src/nvim/memline.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index cd6cdf724b..97a2019143 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -386,8 +386,7 @@ int ml_open(buf_T *buf)
/*
* Allocate first data block and create an empty line 1.
*/
- if ((hp = ml_new_data(mfp, FALSE, 1)) == NULL)
- goto error;
+ hp = ml_new_data(mfp, FALSE, 1);
if (hp->bh_bnum != 2) {
EMSG(_("E298: Didn't get block nr 2?"));
goto error;
@@ -2321,12 +2320,7 @@ ml_append_int (
}
page_count = ((space_needed + HEADER_SIZE) + page_size - 1) / page_size;
- if ((hp_new = ml_new_data(mfp, newfile, page_count)) == NULL) {
- /* correct line counts in pointer blocks */
- --(buf->b_ml.ml_locked_lineadd);
- --(buf->b_ml.ml_locked_high);
- return FAIL;
- }
+ hp_new = ml_new_data(mfp, newfile, page_count);
if (db_idx < 0) { /* left block is new */
hp_left = hp_new;
hp_right = hp;