From: Steinar H. Gunderson Date: Fri, 27 May 2016 08:13:26 +0000 (+0200) Subject: Fix a memory leak with raw inputs. X-Git-Tag: 1.3.0~4 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=c1bfe37ff48881cfd44d4bf2952e9f9a1cdabb12 Fix a memory leak with raw inputs. --- 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.