aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/term.c')
-rw-r--r--src/nvim/term.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 733bef8b5f..073ed30052 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -4304,14 +4304,9 @@ replace_termcodes (
}
result[dlen] = NUL;
- /*
- * Copy the new string to allocated memory.
- * If this fails, just return from.
- */
- *bufp = vim_strsave(result);
- from = *bufp;
- free(result);
- return from;
+ *bufp = xrealloc(result, dlen + 1);
+
+ return *bufp;
}
/*