From e3e1f20c7f5071fb9d1912619a899e542c5d9c71 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Fri, 9 Jun 2017 23:13:35 +0200 Subject: [PATCH] C++ binding: Fixup memory leak in input module receive() calls The Input::send() method allocated glib strings and copied input data, but only released the glib string container and leaked the actual string content. This led to leaks in the size of the verbatim input file, which is especially wasteful for uncompressed textual representations. This fixes bug #976. --- bindings/cxx/classes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 03b81edb..e4340fdf 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -1407,7 +1407,7 @@ void Input::send(void *data, size_t length) { auto gstr = g_string_new_len(static_cast(data), length); auto ret = sr_input_send(_structure, gstr); - g_string_free(gstr, false); + g_string_free(gstr, true); check(ret); }