From 80440c3c336e528063a6690317987fec5cbfda80 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 16 Feb 2010 23:54:02 +0100 Subject: [PATCH] write_http plugin: Fixed a memory leak in the "StoreRates" code. --- src/write_http.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/write_http.c b/src/write_http.c index 62e3cf3b..a7aafec8 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -288,9 +288,15 @@ static int wh_value_list_to_string (char *buffer, /* {{{ */ status = ssnprintf (buffer + offset, buffer_size - offset, \ __VA_ARGS__); \ if (status < 1) \ + { \ + sfree (rates); \ return (-1); \ + } \ else if (((size_t) status) >= (buffer_size - offset)) \ + { \ + sfree (rates); \ return (-1); \ + } \ else \ offset += ((size_t) status); \ } while (0) @@ -332,6 +338,7 @@ static int wh_value_list_to_string (char *buffer, /* {{{ */ #undef BUFFER_ADD +sfree (rates); return (0); } /* }}} int wh_value_list_to_string */ -- 2.30.2