diff options
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r-- | src/nvim/ui.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index a1254ea04f..6d27822bc0 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -272,12 +272,10 @@ int vim_is_input_buf_empty(void) */ char_u *get_input_buf(void) { - garray_T *gap; - /* We use a growarray to store the data pointer and the length. */ - gap = (garray_T *)alloc((unsigned)sizeof(garray_T)); + garray_T *gap = xmalloc(sizeof(garray_T)); /* Add one to avoid a zero size. */ - gap->ga_data = alloc((unsigned)inbufcount + 1); + gap->ga_data = xmalloc(inbufcount + 1); if (gap->ga_data != NULL) memmove(gap->ga_data, inbuf, (size_t)inbufcount); gap->ga_len = inbufcount; |