commit bd0e8d8455d44450a709065824f268f32124f19a
parent a75a6516bd962b780c7c56b07ac16ac53a2c577a
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Tue, 29 Jan 2019 23:13:51 +0100
Fix a memory leak in Litehtml plugin's http loader
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/litehtml_viewer/http.cpp b/src/plugins/litehtml_viewer/http.cpp
@@ -73,7 +73,7 @@ GInputStream *http::load_url(const gchar *url, GError **error)
if (!strncmp(url, "file:///", 8) || g_file_test(url, G_FILE_TEST_EXISTS)) {
gchar* newurl = g_filename_from_uri(url, NULL, NULL);
if (g_file_get_contents(newurl ? newurl : url, &content, &len, &_error)) {
- stream = g_memory_input_stream_new_from_data(content, len, NULL);
+ stream = g_memory_input_stream_new_from_data(content, len, g_free);
} else {
debug_print("Got error: %s\n", _error->message);
}
@@ -88,7 +88,7 @@ GInputStream *http::load_url(const gchar *url, GError **error)
} else {
debug_print("Image size: %d\n", data.size);
stream = g_memory_input_stream_new_from_data(
- g_memdup(data.memory, data.size), data.size, NULL);
+ g_memdup(data.memory, data.size), data.size, g_free);
g_free(data.memory);
}
}