summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c9615b)
raw | patch | inline | side by side (parent: 9c9615b)
author | Florian Forster <octo@collectd.org> | |
Wed, 3 Aug 2016 19:35:36 +0000 (21:35 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 3 Aug 2016 19:43:58 +0000 (21:43 +0200) |
This function is called from wh_callback_free() which is used to clean up after
?alloc() failures, so the "send_buffer" field may actually be NULL.
Issue: #1835
?alloc() failures, so the "send_buffer" field may actually be NULL.
Issue: #1835
src/write_http.c | patch | blob | history |
diff --git a/src/write_http.c b/src/write_http.c
index 3d50be539b0141e8a3d75f6bc8bd49283d7574fe..ec538b6129dddf78e8093e10264f8b5e870df218 100644 (file)
--- a/src/write_http.c
+++ b/src/write_http.c
static void wh_reset_buffer (wh_callback_t *cb) /* {{{ */
{
+ if ((cb == NULL) || (cb->send_buffer == NULL))
+ return;
+
memset (cb->send_buffer, 0, cb->send_buffer_size);
cb->send_buffer_free = cb->send_buffer_size;
cb->send_buffer_fill = 0;
cb = data;
- wh_flush_nolock (/* timeout = */ 0, cb);
+ if (cb->send_buffer != NULL)
+ wh_flush_nolock (/* timeout = */ 0, cb);
if (cb->curl != NULL)
{