From dc928d299a9eb019e4701d53a7a13dc2cb2789e5 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 5 Jun 2016 14:36:36 +0200 Subject: [PATCH] wg_send_buffer: return error if fd < 0 CID 116310 --- src/write_graphite.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.30.2