From: Ruben Kerkhof Date: Sun, 5 Jun 2016 12:36:36 +0000 (+0200) Subject: wg_send_buffer: return error if fd < 0 X-Git-Tag: collectd-5.6.0~228^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dc928d299a9eb019e4701d53a7a13dc2cb2789e5;p=collectd.git wg_send_buffer: return error if fd < 0 CID 116310 --- diff --git a/src/write_graphite.c b/src/write_graphite.c index 3dc4df42..0f9a8bea 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -137,6 +137,9 @@ static int wg_send_buffer (struct wg_callback *cb) { ssize_t status; + if (cb->sock_fd < 0) + return (-1); + status = swrite (cb->sock_fd, cb->send_buf, strlen (cb->send_buf)); if (status != 0) {