mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
API: Refactor: Duplicate/free string arguments coming from msgpack
When receiving strings *from* msgpack, we don't need to duplicate/free since the data only lives in the msgpack parse buffer until the end of the call. But in order to reuse `msgpack_rpc_free_object` when sending event data(which is sent *to* msgpack), Strings must be freed, which means they must also be allocated separately.
This commit is contained in:
@@ -307,7 +307,7 @@ Integer buffer_get_number(Buffer buffer, Error *err)
|
||||
|
||||
String buffer_get_name(Buffer buffer, Error *err)
|
||||
{
|
||||
String rv = {.size = 0, .data = ""};
|
||||
String rv = STRING_INIT;
|
||||
buf_T *buf = find_buffer(buffer, err);
|
||||
|
||||
if (!buf || buf->b_ffname == NULL) {
|
||||
|
Reference in New Issue
Block a user