aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 03dd972df1..7c50b1721c 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -26,6 +26,7 @@
#include <string.h>
+#include "nvim/api/private/handle.h"
#include "nvim/vim.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
@@ -538,6 +539,7 @@ void buf_freeall(buf_T *buf, int flags)
*/
static void free_buffer(buf_T *buf)
{
+ handle_unregister_buffer(buf);
free_buffer_stuff(buf, TRUE);
unref_var_dict(buf->b_vars);
aubuflocal_remove(buf);
@@ -1362,6 +1364,7 @@ buflist_new (
}
if (buf != curbuf || curbuf == NULL) {
buf = xcalloc(1, sizeof(buf_T));
+ handle_register_buffer(buf);
/* init b: variables */
buf->b_vars = dict_alloc();
init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE);
@@ -2235,9 +2238,8 @@ setfname (
close_buffer(NULL, obuf, DOBUF_WIPE, FALSE);
}
sfname = vim_strsave(sfname);
- if (ffname == NULL || sfname == NULL) {
+ if (ffname == NULL) {
free(sfname);
- free(ffname);
return FAIL;
}
#ifdef USE_FNAME_CASE
@@ -4114,8 +4116,6 @@ chk_modeline (
while (s[-1] != ':');
s = linecopy = vim_strsave(s); /* copy the line, it will change */
- if (linecopy == NULL)
- return FAIL;
save_sourcing_lnum = sourcing_lnum;
save_sourcing_name = sourcing_name;