commit f544f20bb21e729c67b219e8d707177cbf96ff3e
parent 24d8ebd06b2740620118550ebc73af45b8392415
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Thu, 25 Apr 2019 22:40:31 +0200
Fix a memory leak in litehtml plugin's container_linux::load_image()
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp
@@ -109,7 +109,7 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml::
unlock_images_cache();
if (!found) {
- struct FetchCtx *ctx = g_new(struct FetchCtx, 1);
+ struct FetchCtx *ctx;
/* Attached images can be loaded into cache right here. */
if (!strncmp(src, "cid:", 4)) {
@@ -128,6 +128,7 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml::
debug_print("allowing download of image from '%s'\n", src);
+ ctx = g_new(struct FetchCtx, 1);
ctx->url = g_strdup(url.c_str());
ctx->container = this;