aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r--src/nvim/api/private/helpers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index a43e7a8d2a..861ac8cc1b 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -267,6 +267,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err)
char *val = xstrndup(value.data.string.data, value.data.string.size);
set_option_value_for(key, 0, val, opt_flags, type, to, err);
+ free(val);
}
cleanup:
@@ -319,7 +320,7 @@ tabpage_T * find_tab(Tabpage tabpage, Error *err)
String cstr_to_string(const char *str) {
if (str == NULL) {
- return (String) { .data = NULL, .size = 0 };
+ return (String) STRING_INIT;
}
size_t len = strlen(str);