From c1bfe37ff48881cfd44d4bf2952e9f9a1cdabb12 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 27 May 2016 10:13:26 +0200 Subject: [PATCH 1/1] Fix a memory leak with raw inputs. --- httpinput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpinput.cpp b/httpinput.cpp index 9dcaeaa..78e73a1 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -495,7 +495,6 @@ void HTTPInput::do_work() void HTTPInput::process_data(char *ptr, size_t bytes) { - pending_data.insert(pending_data.end(), ptr, ptr + bytes); { MutexLock mutex(&stats_mutex); stats.bytes_received += bytes; @@ -509,6 +508,7 @@ void HTTPInput::process_data(char *ptr, size_t bytes) } assert(encoding == Input::INPUT_ENCODING_METACUBE); + pending_data.insert(pending_data.end(), ptr, ptr + bytes); for ( ;; ) { // If we don't have enough data (yet) for even the Metacube header, just return. -- 2.39.2