mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
wstream: allow empty release wbuffer cb
Sometimes a wbuffer is not supposed to be free()'d (such as when it comes from a constant (possibly static) string, for example.
This commit is contained in:
parent
06cc046e30
commit
891b4b9d2b
@ -204,7 +204,10 @@ static void write_cb(uv_write_t *req, int status)
|
||||
static void release_wbuffer(WBuffer *buffer)
|
||||
{
|
||||
if (!--buffer->refcount) {
|
||||
buffer->cb(buffer->data);
|
||||
if (buffer->cb) {
|
||||
buffer->cb(buffer->data);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user